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-76.c (3.29 KB)      -rw-r--r--
Select action/file-type:
(+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
/* PR tree-optimization/91294 - strlen result of a conditional with
   an offset
   { dg-do run }
   { dg-options "-O2 -Wall" } */

#include "strlenopt.h"

#define NOIPA __attribute__ ((noclone, noinline, noipa))

#define assert(expr)                        \
  ((expr)                                                       \
   ? (void)0                                                    \
   : (__builtin_printf ("line %i %s: assertion failed: %s\n",    \
                        __LINE__, __func__, #expr),        \
      __builtin_abort ()))

int i = 0;

const char s[] = "1234567";

char a[32];

NOIPA void lower_bound_assign_into_empty (void)
{
  a[0] = '1';
  a[1] = '2';
  a[2] = '3';
  assert (strlen (a) == 3);
}

NOIPA void lower_bound_assign_into_longest (void)
{
  a[0] = '1';
  a[1] = '2';
  a[2] = '3';
  assert (strlen (a) == 31);
}


NOIPA void lower_bound_assign_into_empty_idx_3 (int idx)
{
  a[0] = '1';
  a[1] = '2';
  a[2] = '3';
  a[idx] = 'x';
  assert (strlen (a) == 4);
}

NOIPA void lower_bound_assign_into_longest_idx_2 (int idx)
{
  a[0] = '1';
  a[1] = '2';
  a[2] = '3';
  a[idx] = '\0';
  assert (strlen (a) == 2);
}


NOIPA void lower_bound_memcpy_into_empty (void)
{
  memcpy (a, "123", 3);
  assert (strlen (a) == 3);
}

NOIPA void lower_bound_memcpy_into_longest (void)
{
  memcpy (a, "123", 3);
  assert (strlen (a) == 31);
}


NOIPA void lower_bound_memcpy_memcpy_into_empty (void)
{
  memcpy (a, "123", 3);
  memcpy (a + 2, "345", 3);
  assert (strlen (a) == 5);
}

NOIPA void lower_bound_memcpy_memcpy_into_longest (void)
{
  memcpy (a, "123", 3);
  memcpy (a + 2, "345", 3);
  assert (strlen (a) == 31);
}


NOIPA void memove_forward_strlen (void)
{
  char a[] = "123456";

  memmove (a, a + 1, sizeof a - 1);

  assert (strlen (a) == 5);
}

NOIPA void memove_backward_into_empty_strlen (void)
{
  strcpy (a, "123456");

  memmove (a + 1, a, 6);

  assert (strlen (a) == 7);
}

NOIPA void memove_backward_into_longest_strlen (void)
{
  memcpy (a, "123456", 6);

  memmove (a + 1, a, 6);

  assert (strlen (a) == 31);
}

NOIPA void memove_strcmp (void)
{
  /* Test derived from libstdc++-v3's
     20_util/specialized_algorithms/memory_management_tools/1.cc  */

  char a[] = "123456";
  char b[] = "000000";

  memmove (b, a, sizeof a);

  assert (strlen (a) == 6);
  assert (strlen (b) == 6);
  assert (strcmp (a, b) == 0);
}


int main (void)
{
  memset (a, '\0', sizeof a);
  lower_bound_assign_into_empty ();

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  lower_bound_assign_into_longest ();

  memset (a, '\0', sizeof a);
  lower_bound_assign_into_empty_idx_3 (3);

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  lower_bound_assign_into_longest_idx_2 (2);

  memset (a, '\0', sizeof a);
  lower_bound_memcpy_into_empty ();

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  lower_bound_memcpy_into_longest ();

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  lower_bound_memcpy_into_longest ();

  memset (a, '\0', sizeof a);
  lower_bound_memcpy_memcpy_into_empty ();

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  lower_bound_memcpy_memcpy_into_longest ();

  memove_forward_strlen ();

  memset (a, '\0', sizeof a);
  memove_backward_into_empty_strlen ();

  memset (a, 'x', sizeof a - 1);
  a[sizeof a - 1] = '\0';
  memove_backward_into_longest_strlen ();

  memove_strcmp ();
}

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