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:     Wstringop-overflow-12.c (4.2 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/89350 - Wrong -Wstringop-overflow warning
   on a variable offset from the end of an array
   Test exercising -Wstringop-truncation alone, with -Warray-bounds
   explicitly disabled.
   { dg-do compile }
   { dg-options "-O2 -Wno-array-bounds -Wstringop-overflow -ftrack-macro-expansion=0" }  */

#include "range.h"

extern void* memcpy (void*, const void*, size_t);
extern void* memset (void*, int, size_t);

void sink (void*);

extern char ga7[7];


#define T(d, n) (memcpy ((d), s, (n)), sink (d))

void test_memcpy_array_cst_range_off (const void *s)
{
  char *d = ga7 + 1;

  T (d + UR (1, 2), 1);
  T (d + UR (1, 2), 5);

  T (d + UR (0, 1), 6);
  T (d + UR (0, 1), 7);       /* { dg-warning ".memcpy. writing 7 bytes into a region of size 6 overflows the destination" "pr89428" } */
  T (d + UR (1, 2), 6);       /* { dg-warning ".memcpy. writing 6 bytes into a region of size 5 overflows the destination" } */
  T (d + UR (1, 2), 7);       /* { dg-warning "writing 7 bytes into a region of size 5 " } */

  T (d + SR (-3, -2), 1);     /* { dg-warning "writing 1 byte into a region of size 0 " } */
  T (d + SR (-2, -1), 1);
  T (d + SR (-2, -1), 2);     /* { dg-warning "writing 2 bytes into a region of size 7 " "pr89428" { xfail *-*-* } } */
  T (d + SR (-2, -1), 9);     /* { dg-warning "writing 9 bytes into a region of size 7 " } */

  d = ga7 + 7;
  T (d + SR (-7, -6), 1);
  T (d + SR (-7, -1), 1);
  T (d + SR (-2, -1), 3);     /* { dg-warning "writing 3 bytes into a region of size 2 " } */

  T (d + UR (1, 2), 1);       /* { dg-warning "writing 1 byte into a region of size 0 " } */
}


void test_memcpy_array_range_range_off (const void *s)
{
  char *d = ga7 + UR (0, 1);
  T (d + SR (-1, 0), 1);
  T (d + SR (-1, 0), 7);
  T (d + SR (-1, 0), 8);       /* { dg-warning "writing 8 bytes into a region of size 7 " } */
  T (d + SR (-1, 0), 9);       /* { dg-warning "writing 9 bytes into a region of size 7 " "pr89350" } */
}


#undef T
#define T(d, n) (memset ((d), 0, (n)), sink (d))

void test_memset_array_unsigned_off (void)
{
  char *d = ga7 + 1;

  T (d + UR (1, 2), 1);
  T (d + UR (1, 2), 5);

  T (d + UR (0, 1), 6);
  T (d + UR (0, 1), 7);       /* { dg-warning ".memset. writing 7 bytes into a region of size 6 overflows the destination" "pr89428" } */
  T (d + UR (1, 2), 6);       /* { dg-warning ".memset. writing 6 bytes into a region of size 5 overflows the destination" } */
  T (d + UR (1, 2), 7);       /* { dg-warning "writing 7 bytes into a region of size 5 " } */

  T (d + SR (-3, -2), 1);     /* { dg-warning "writing 1 byte into a region of size 0 " } */
  T (d + SR (-2, -1), 1);
  T (d + SR (-2, -1), 2);     /* { dg-warning "writing 2 bytes into a region of size 7 " "pr89428" { xfail *-*-* } } */
  T (d + SR (-2, -1), 9);     /* { dg-warning "writing 9 bytes into a region of size 7 " } */

  d = ga7 + 7;
  T (d + SR (-7, -6), 1);
  T (d + SR (-7, -1), 1);
  T (d + SR (-2, -1), 3);     /* { dg-warning "writing 3 bytes into a region of size 2 " } */

  T (d + UR (1, 2), 1);       /* { dg-warning "writing 1 byte into a region of size 0 " } */
}



struct MemArray { char a7[7], a3[3], c; };

extern struct MemArray gma;

void test_memset_memarray (void)
{
  char *d = gma.a7 + 1;

  T (d + UR (1, 2), 1);
  T (d + UR (1, 2), 5);

  T (d + UR (0, 1), 6);
  T (d + UR (0, 1), 7);       /* { dg-warning ".memset. writing 6 bytes into a region of size 5 overflows the destination" "pr89428" { xfail *-*-* } } */
  T (d + UR (1, 2), 6);       /* { dg-warning ".memset. writing 6 bytes into a region of size 5 overflows the destination" "pr89350" { xfail *-*-* } } */
  T (d + UR (1, 2), 7);       /* { dg-warning "writing 7 bytes into a region of size 5 " "pr85350" { xfail *-*-* } } */

}


#undef T
#define T(d, n) (memcpy ((d), s, (n)), sink (d))

void test_memcpy_array_signed_off (const void *s)
{
  char *d = ga7 + 1;

  T (d + SR (-7, 7), 7);
  T (d + SR (-1, 1), 7);
  T (d + SR (-1, 1), 9);      /* { dg-warning "writing 9 bytes into a region of size " } */
  T (d + SR (-1, 2), 9);      /* { dg-warning "writing 9 bytes into a region of size " } */
  T (d + SR (1, 2), 1);
  T (d + SR (1, 2), 5);

  T (d + SR (0, 1), 6);
  T (d + UR (1, 2), 7);       /* { dg-warning "\\\[-Warray-bounds|-Wstringop-overflow" } */
}

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