Closed d33tah closed 6 years ago
The C code is calling a function save_if_interesting
but that function is not defined in the C sources.
Note the following warning when compiling this as C code:
afl-fuzz-single.c:643:3: warning: implicit declaration of function
'save_if_interesting' is invalid in C99 [-Wimplicit-function-declaration]
Feel free to open a new issue if there turns out to be another problem in translating this code when that function's definition is included!
@glguy Sorry, I meant this file:
# 1 "afl-fuzz-single.c"
# 1 "<built-in>"
# 1 "<command-line>"
# 31 "<command-line>"
# 1 "/usr/include/stdc-predef.h" 1 3 4
# 32 "<command-line>" 2
# 1 "afl-fuzz-single.c"
# 23 "afl-fuzz-single.c"
# 1 "config.h" 1
# 20 "config.h"
# 1 "types.h" 1
# 20 "types.h"
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h" 1 3 4
# 9 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h" 3 4
# 1 "/usr/include/stdint.h" 1 3 4
# 26 "/usr/include/stdint.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 33 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 3 4
# 1 "/usr/include/features.h" 1 3 4
# 424 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 1 3 4
# 427 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 428 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 429 "/usr/include/x86_64-linux-gnu/sys/cdefs.h" 2 3 4
# 425 "/usr/include/features.h" 2 3 4
# 448 "/usr/include/features.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 1 3 4
# 10 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/gnu/stubs-64.h" 1 3 4
# 11 "/usr/include/x86_64-linux-gnu/gnu/stubs.h" 2 3 4
# 449 "/usr/include/features.h" 2 3 4
# 34 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 2 3 4
# 27 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
# 30 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
typedef unsigned char __u_char;
typedef unsigned short int __u_short;
typedef unsigned int __u_int;
typedef unsigned long int __u_long;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef signed short int __int16_t;
typedef unsigned short int __uint16_t;
typedef signed int __int32_t;
typedef unsigned int __uint32_t;
typedef signed long int __int64_t;
typedef unsigned long int __uint64_t;
typedef long int __quad_t;
typedef unsigned long int __u_quad_t;
typedef long int __intmax_t;
typedef unsigned long int __uintmax_t;
# 130 "/usr/include/x86_64-linux-gnu/bits/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/typesizes.h" 1 3 4
# 131 "/usr/include/x86_64-linux-gnu/bits/types.h" 2 3 4
typedef unsigned long int __dev_t;
typedef unsigned int __uid_t;
typedef unsigned int __gid_t;
typedef unsigned long int __ino_t;
typedef unsigned long int __ino64_t;
typedef unsigned int __mode_t;
typedef unsigned long int __nlink_t;
typedef long int __off_t;
typedef long int __off64_t;
typedef int __pid_t;
typedef struct { int __val[2]; } __fsid_t;
typedef long int __clock_t;
typedef unsigned long int __rlim_t;
typedef unsigned long int __rlim64_t;
typedef unsigned int __id_t;
typedef long int __time_t;
typedef unsigned int __useconds_t;
typedef long int __suseconds_t;
typedef int __daddr_t;
typedef int __key_t;
typedef int __clockid_t;
typedef void * __timer_t;
typedef long int __blksize_t;
typedef long int __blkcnt_t;
typedef long int __blkcnt64_t;
typedef unsigned long int __fsblkcnt_t;
typedef unsigned long int __fsblkcnt64_t;
typedef unsigned long int __fsfilcnt_t;
typedef unsigned long int __fsfilcnt64_t;
typedef long int __fsword_t;
typedef long int __ssize_t;
typedef long int __syscall_slong_t;
typedef unsigned long int __syscall_ulong_t;
typedef __off64_t __loff_t;
typedef char *__caddr_t;
typedef long int __intptr_t;
typedef unsigned int __socklen_t;
typedef int __sig_atomic_t;
# 28 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wchar.h" 1 3 4
# 29 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 30 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-intn.h" 3 4
typedef __int8_t int8_t;
typedef __int16_t int16_t;
typedef __int32_t int32_t;
typedef __int64_t int64_t;
# 35 "/usr/include/stdint.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/stdint-uintn.h" 3 4
typedef __uint8_t uint8_t;
typedef __uint16_t uint16_t;
typedef __uint32_t uint32_t;
typedef __uint64_t uint64_t;
# 38 "/usr/include/stdint.h" 2 3 4
typedef signed char int_least8_t;
typedef short int int_least16_t;
typedef int int_least32_t;
typedef long int int_least64_t;
typedef unsigned char uint_least8_t;
typedef unsigned short int uint_least16_t;
typedef unsigned int uint_least32_t;
typedef unsigned long int uint_least64_t;
# 68 "/usr/include/stdint.h" 3 4
typedef signed char int_fast8_t;
typedef long int int_fast16_t;
typedef long int int_fast32_t;
typedef long int int_fast64_t;
# 81 "/usr/include/stdint.h" 3 4
typedef unsigned char uint_fast8_t;
typedef unsigned long int uint_fast16_t;
typedef unsigned long int uint_fast32_t;
typedef unsigned long int uint_fast64_t;
# 97 "/usr/include/stdint.h" 3 4
typedef long int intptr_t;
typedef unsigned long int uintptr_t;
# 111 "/usr/include/stdint.h" 3 4
typedef __intmax_t intmax_t;
typedef __uintmax_t uintmax_t;
# 10 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stdint.h" 2 3 4
# 21 "types.h" 2
# 1 "/usr/include/stdlib.h" 1 3 4
# 25 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 26 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 216 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 3 4
typedef long unsigned int size_t;
# 328 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 3 4
typedef int wchar_t;
# 32 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 1 3 4
# 52 "/usr/include/x86_64-linux-gnu/bits/waitflags.h" 3 4
typedef enum
{
P_ALL,
P_PID,
P_PGID
} idtype_t;
# 40 "/usr/include/stdlib.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/waitstatus.h" 1 3 4
# 41 "/usr/include/stdlib.h" 2 3 4
# 55 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 1 3 4
# 120 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/long-double.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/bits/floatn-common.h" 2 3 4
# 121 "/usr/include/x86_64-linux-gnu/bits/floatn.h" 2 3 4
# 56 "/usr/include/stdlib.h" 2 3 4
typedef struct
{
int quot;
int rem;
} div_t;
typedef struct
{
long int quot;
long int rem;
} ldiv_t;
__extension__ typedef struct
{
long long int quot;
long long int rem;
} lldiv_t;
# 97 "/usr/include/stdlib.h" 3 4
extern size_t __ctype_get_mb_cur_max (void) __attribute__ ((__nothrow__ , __leaf__)) ;
extern double atof (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern int atoi (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern long int atol (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
__extension__ extern long long int atoll (const char *__nptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
extern double strtod (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern float strtof (const char *__restrict __nptr,
char **__restrict __endptr) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long double strtold (const char *__restrict __nptr,
char **__restrict __endptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 176 "/usr/include/stdlib.h" 3 4
extern long int strtol (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern unsigned long int strtoul (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtouq (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern long long int strtoll (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
__extension__
extern unsigned long long int strtoull (const char *__restrict __nptr,
char **__restrict __endptr, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 385 "/usr/include/stdlib.h" 3 4
extern char *l64a (long int __n) __attribute__ ((__nothrow__ , __leaf__)) ;
extern long int a64l (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1))) ;
# 1 "/usr/include/x86_64-linux-gnu/sys/types.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __u_char u_char;
typedef __u_short u_short;
typedef __u_int u_int;
typedef __u_long u_long;
typedef __quad_t quad_t;
typedef __u_quad_t u_quad_t;
typedef __fsid_t fsid_t;
typedef __loff_t loff_t;
typedef __ino_t ino_t;
# 60 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __dev_t dev_t;
typedef __gid_t gid_t;
typedef __mode_t mode_t;
typedef __nlink_t nlink_t;
typedef __uid_t uid_t;
typedef __off_t off_t;
# 98 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef __pid_t pid_t;
typedef __id_t id_t;
typedef __ssize_t ssize_t;
typedef __daddr_t daddr_t;
typedef __caddr_t caddr_t;
typedef __key_t key_t;
# 1 "/usr/include/x86_64-linux-gnu/bits/types/clock_t.h" 1 3 4
typedef __clock_t clock_t;
# 128 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/clockid_t.h" 1 3 4
typedef __clockid_t clockid_t;
# 130 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/time_t.h" 1 3 4
typedef __time_t time_t;
# 131 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/timer_t.h" 1 3 4
typedef __timer_t timer_t;
# 132 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 145 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 146 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef unsigned long int ulong;
typedef unsigned short int ushort;
typedef unsigned int uint;
# 178 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
typedef unsigned int u_int8_t __attribute__ ((__mode__ (__QI__)));
typedef unsigned int u_int16_t __attribute__ ((__mode__ (__HI__)));
typedef unsigned int u_int32_t __attribute__ ((__mode__ (__SI__)));
typedef unsigned int u_int64_t __attribute__ ((__mode__ (__DI__)));
typedef int register_t __attribute__ ((__mode__ (__word__)));
# 194 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/endian.h" 1 3 4
# 36 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/endian.h" 1 3 4
# 37 "/usr/include/endian.h" 2 3 4
# 60 "/usr/include/endian.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap-16.h" 1 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 2 3 4
# 44 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline unsigned int
__bswap_32 (unsigned int __bsx)
{
return __builtin_bswap32 (__bsx);
}
# 108 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 3 4
static __inline __uint64_t
__bswap_64 (__uint64_t __bsx)
{
return __builtin_bswap64 (__bsx);
}
# 61 "/usr/include/endian.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 32 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 3 4
static __inline __uint16_t
__uint16_identity (__uint16_t __x)
{
return __x;
}
static __inline __uint32_t
__uint32_identity (__uint32_t __x)
{
return __x;
}
static __inline __uint64_t
__uint64_identity (__uint64_t __x)
{
return __x;
}
# 62 "/usr/include/endian.h" 2 3 4
# 195 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/select.h" 1 3 4
# 30 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/select.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/select.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/select.h" 2 3 4
# 31 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigset_t.h" 1 3 4
typedef struct
{
unsigned long int __val[(1024 / (8 * sizeof (unsigned long int)))];
} __sigset_t;
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigset_t.h" 2 3 4
typedef __sigset_t sigset_t;
# 34 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timeval.h" 1 3 4
struct timeval
{
__time_t tv_sec;
__suseconds_t tv_usec;
};
# 38 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_timespec.h" 1 3 4
struct timespec
{
__time_t tv_sec;
__syscall_slong_t tv_nsec;
};
# 40 "/usr/include/x86_64-linux-gnu/sys/select.h" 2 3 4
typedef __suseconds_t suseconds_t;
typedef long int __fd_mask;
# 59 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
typedef struct
{
__fd_mask __fds_bits[1024 / (8 * (int) sizeof (__fd_mask))];
} fd_set;
typedef __fd_mask fd_mask;
# 91 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 101 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int select (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
struct timeval *__restrict __timeout);
# 113 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
extern int pselect (int __nfds, fd_set *__restrict __readfds,
fd_set *__restrict __writefds,
fd_set *__restrict __exceptfds,
const struct timespec *__restrict __timeout,
const __sigset_t *__restrict __sigmask);
# 126 "/usr/include/x86_64-linux-gnu/sys/select.h" 3 4
# 198 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 1 3 4
# 41 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sysmacros.h" 1 3 4
# 42 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 2 3 4
# 71 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
extern unsigned int gnu_dev_major (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern unsigned int gnu_dev_minor (__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern __dev_t gnu_dev_makedev (unsigned int __major, unsigned int __minor) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 85 "/usr/include/x86_64-linux-gnu/sys/sysmacros.h" 3 4
# 206 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
typedef __blksize_t blksize_t;
typedef __blkcnt_t blkcnt_t;
typedef __fsblkcnt_t fsblkcnt_t;
typedef __fsfilcnt_t fsfilcnt_t;
# 254 "/usr/include/x86_64-linux-gnu/sys/types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 1 3 4
# 77 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 1 3 4
# 21 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 2 3 4
# 65 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
struct __pthread_rwlock_arch_t
{
unsigned int __readers;
unsigned int __writers;
unsigned int __wrphase_futex;
unsigned int __writers_futex;
unsigned int __pad3;
unsigned int __pad4;
int __cur_writer;
int __shared;
signed char __rwelision;
unsigned char __pad1[7];
unsigned long int __pad2;
unsigned int __flags;
# 99 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes-arch.h" 3 4
};
# 78 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 2 3 4
typedef struct __pthread_internal_list
{
struct __pthread_internal_list *__prev;
struct __pthread_internal_list *__next;
} __pthread_list_t;
# 118 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
struct __pthread_mutex_s
{
int __lock ;
unsigned int __count;
int __owner;
unsigned int __nusers;
int __kind;
short __spins; short __elision;
__pthread_list_t __list;
# 145 "/usr/include/x86_64-linux-gnu/bits/thread-shared-types.h" 3 4
};
struct __pthread_cond_s
{
__extension__ union
{
__extension__ unsigned long long int __wseq;
struct
{
unsigned int __low;
unsigned int __high;
} __wseq32;
};
__extension__ union
{
__extension__ unsigned long long int __g1_start;
struct
{
unsigned int __low;
unsigned int __high;
} __g1_start32;
};
unsigned int __g_refs[2] ;
unsigned int __g_size[2];
unsigned int __g1_orig_size;
unsigned int __wrefs;
unsigned int __g_signals[2];
};
# 24 "/usr/include/x86_64-linux-gnu/bits/pthreadtypes.h" 2 3 4
typedef unsigned long int pthread_t;
typedef union
{
char __size[4];
int __align;
} pthread_mutexattr_t;
typedef union
{
char __size[4];
int __align;
} pthread_condattr_t;
typedef unsigned int pthread_key_t;
typedef int pthread_once_t;
union pthread_attr_t
{
char __size[56];
long int __align;
};
typedef union pthread_attr_t pthread_attr_t;
typedef union
{
struct __pthread_mutex_s __data;
char __size[40];
long int __align;
} pthread_mutex_t;
typedef union
{
struct __pthread_cond_s __data;
char __size[48];
__extension__ long long int __align;
} pthread_cond_t;
typedef union
{
struct __pthread_rwlock_arch_t __data;
char __size[56];
long int __align;
} pthread_rwlock_t;
typedef union
{
char __size[8];
long int __align;
} pthread_rwlockattr_t;
typedef volatile int pthread_spinlock_t;
typedef union
{
char __size[32];
long int __align;
} pthread_barrier_t;
typedef union
{
char __size[4];
int __align;
} pthread_barrierattr_t;
# 255 "/usr/include/x86_64-linux-gnu/sys/types.h" 2 3 4
# 395 "/usr/include/stdlib.h" 2 3 4
extern long int random (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srandom (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern char *initstate (unsigned int __seed, char *__statebuf,
size_t __statelen) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *setstate (char *__statebuf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct random_data
{
int32_t *fptr;
int32_t *rptr;
int32_t *state;
int rand_type;
int rand_deg;
int rand_sep;
int32_t *end_ptr;
};
extern int random_r (struct random_data *__restrict __buf,
int32_t *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srandom_r (unsigned int __seed, struct random_data *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int initstate_r (unsigned int __seed, char *__restrict __statebuf,
size_t __statelen,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int setstate_r (char *__restrict __statebuf,
struct random_data *__restrict __buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int rand (void) __attribute__ ((__nothrow__ , __leaf__));
extern void srand (unsigned int __seed) __attribute__ ((__nothrow__ , __leaf__));
extern int rand_r (unsigned int *__seed) __attribute__ ((__nothrow__ , __leaf__));
extern double drand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern double erand48 (unsigned short int __xsubi[3]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int lrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int nrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int mrand48 (void) __attribute__ ((__nothrow__ , __leaf__));
extern long int jrand48 (unsigned short int __xsubi[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void srand48 (long int __seedval) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned short int *seed48 (unsigned short int __seed16v[3])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void lcong48 (unsigned short int __param[7]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
struct drand48_data
{
unsigned short int __x[3];
unsigned short int __old_x[3];
unsigned short int __c;
unsigned short int __init;
__extension__ unsigned long long int __a;
};
extern int drand48_r (struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int erand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
double *__restrict __result) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int nrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int mrand48_r (struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int jrand48_r (unsigned short int __xsubi[3],
struct drand48_data *__restrict __buffer,
long int *__restrict __result)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int srand48_r (long int __seedval, struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int seed48_r (unsigned short int __seed16v[3],
struct drand48_data *__buffer) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int lcong48_r (unsigned short int __param[7],
struct drand48_data *__buffer)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *malloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern void *calloc (size_t __nmemb, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern void *realloc (void *__ptr, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__warn_unused_result__));
# 563 "/usr/include/stdlib.h" 3 4
extern void free (void *__ptr) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/alloca.h" 1 3 4
# 24 "/usr/include/alloca.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 25 "/usr/include/alloca.h" 2 3 4
extern void *alloca (size_t __size) __attribute__ ((__nothrow__ , __leaf__));
# 567 "/usr/include/stdlib.h" 2 3 4
extern void *valloc (size_t __size) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern int posix_memalign (void **__memptr, size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern void *aligned_alloc (size_t __alignment, size_t __size)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__alloc_size__ (2))) ;
extern void abort (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern int atexit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int at_quick_exit (void (*__func) (void)) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int on_exit (void (*__func) (int __status, void *__arg), void *__arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void quick_exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern void _Exit (int __status) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__noreturn__));
extern char *getenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 644 "/usr/include/stdlib.h" 3 4
extern int putenv (char *__string) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int setenv (const char *__name, const char *__value, int __replace)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int unsetenv (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int clearenv (void) __attribute__ ((__nothrow__ , __leaf__));
# 672 "/usr/include/stdlib.h" 3 4
extern char *mktemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 685 "/usr/include/stdlib.h" 3 4
extern int mkstemp (char *__template) __attribute__ ((__nonnull__ (1))) ;
# 707 "/usr/include/stdlib.h" 3 4
extern int mkstemps (char *__template, int __suffixlen) __attribute__ ((__nonnull__ (1))) ;
# 728 "/usr/include/stdlib.h" 3 4
extern char *mkdtemp (char *__template) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 781 "/usr/include/stdlib.h" 3 4
extern int system (const char *__command) ;
# 797 "/usr/include/stdlib.h" 3 4
extern char *realpath (const char *__restrict __name,
char *__restrict __resolved) __attribute__ ((__nothrow__ , __leaf__)) ;
typedef int (*__compar_fn_t) (const void *, const void *);
# 817 "/usr/include/stdlib.h" 3 4
extern void *bsearch (const void *__key, const void *__base,
size_t __nmemb, size_t __size, __compar_fn_t __compar)
__attribute__ ((__nonnull__ (1, 2, 5))) ;
extern void qsort (void *__base, size_t __nmemb, size_t __size,
__compar_fn_t __compar) __attribute__ ((__nonnull__ (1, 4)));
# 837 "/usr/include/stdlib.h" 3 4
extern int abs (int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern long int labs (long int __x) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern long long int llabs (long long int __x)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern div_t div (int __numer, int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
extern ldiv_t ldiv (long int __numer, long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
__extension__ extern lldiv_t lldiv (long long int __numer,
long long int __denom)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__)) ;
# 869 "/usr/include/stdlib.h" 3 4
extern char *ecvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *fcvt (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *gcvt (double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern char *qecvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qfcvt (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4))) ;
extern char *qgcvt (long double __value, int __ndigit, char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3))) ;
extern int ecvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int fcvt_r (double __value, int __ndigit, int *__restrict __decpt,
int *__restrict __sign, char *__restrict __buf,
size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qecvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int qfcvt_r (long double __value, int __ndigit,
int *__restrict __decpt, int *__restrict __sign,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4, 5)));
extern int mblen (const char *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int mbtowc (wchar_t *__restrict __pwc,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern int wctomb (char *__s, wchar_t __wchar) __attribute__ ((__nothrow__ , __leaf__));
extern size_t mbstowcs (wchar_t *__restrict __pwcs,
const char *__restrict __s, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern size_t wcstombs (char *__restrict __s,
const wchar_t *__restrict __pwcs, size_t __n)
__attribute__ ((__nothrow__ , __leaf__));
extern int rpmatch (const char *__response) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 954 "/usr/include/stdlib.h" 3 4
extern int getsubopt (char **__restrict __optionp,
char *const *__restrict __tokens,
char **__restrict __valuep)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2, 3))) ;
# 1006 "/usr/include/stdlib.h" 3 4
extern int getloadavg (double __loadavg[], int __nelem)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1016 "/usr/include/stdlib.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdlib-float.h" 1 3 4
# 1017 "/usr/include/stdlib.h" 2 3 4
# 1026 "/usr/include/stdlib.h" 3 4
# 22 "types.h" 2
# 23 "types.h"
typedef uint8_t u8;
typedef uint16_t u16;
typedef uint32_t u32;
typedef uint64_t u64;
typedef int8_t s8;
typedef int16_t s16;
typedef int32_t s32;
typedef int64_t s64;
# 21 "config.h" 2
# 24 "afl-fuzz-single.c" 2
# 1 "debug.h" 1
# 26 "afl-fuzz-single.c" 2
# 1 "alloc-inl.h" 1
# 20 "alloc-inl.h"
# 1 "/usr/include/stdio.h" 1 3 4
# 27 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 28 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 34 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 1 3 4
# 4 "/usr/include/x86_64-linux-gnu/bits/types/__FILE.h" 3 4
struct _IO_FILE;
typedef struct _IO_FILE __FILE;
# 37 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/FILE.h" 1 3 4
struct _IO_FILE;
typedef struct _IO_FILE FILE;
# 38 "/usr/include/stdio.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libio.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/_G_config.h" 1 3 4
# 19 "/usr/include/x86_64-linux-gnu/bits/_G_config.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 20 "/usr/include/x86_64-linux-gnu/bits/_G_config.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 1 3 4
# 13 "/usr/include/x86_64-linux-gnu/bits/types/__mbstate_t.h" 3 4
typedef struct
{
int __count;
union
{
unsigned int __wch;
char __wchb[4];
} __value;
} __mbstate_t;
# 22 "/usr/include/x86_64-linux-gnu/bits/_G_config.h" 2 3 4
typedef struct
{
__off_t __pos;
__mbstate_t __state;
} _G_fpos_t;
typedef struct
{
__off64_t __pos;
__mbstate_t __state;
} _G_fpos64_t;
# 36 "/usr/include/x86_64-linux-gnu/bits/libio.h" 2 3 4
# 53 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h" 1 3 4
# 40 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stdarg.h" 3 4
typedef __builtin_va_list __gnuc_va_list;
# 54 "/usr/include/x86_64-linux-gnu/bits/libio.h" 2 3 4
# 149 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
struct _IO_jump_t; struct _IO_FILE;
typedef void _IO_lock_t;
struct _IO_marker {
struct _IO_marker *_next;
struct _IO_FILE *_sbuf;
int _pos;
# 177 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
};
enum __codecvt_result
{
__codecvt_ok,
__codecvt_partial,
__codecvt_error,
__codecvt_noconv
};
# 245 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
struct _IO_FILE {
int _flags;
char* _IO_read_ptr;
char* _IO_read_end;
char* _IO_read_base;
char* _IO_write_base;
char* _IO_write_ptr;
char* _IO_write_end;
char* _IO_buf_base;
char* _IO_buf_end;
char *_IO_save_base;
char *_IO_backup_base;
char *_IO_save_end;
struct _IO_marker *_markers;
struct _IO_FILE *_chain;
int _fileno;
int _flags2;
__off_t _old_offset;
unsigned short _cur_column;
signed char _vtable_offset;
char _shortbuf[1];
_IO_lock_t *_lock;
# 293 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
__off64_t _offset;
void *__pad1;
void *__pad2;
void *__pad3;
void *__pad4;
size_t __pad5;
int _mode;
char _unused2[15 * sizeof (int) - 4 * sizeof (void *) - sizeof (size_t)];
};
typedef struct _IO_FILE _IO_FILE;
struct _IO_FILE_plus;
extern struct _IO_FILE_plus _IO_2_1_stdin_;
extern struct _IO_FILE_plus _IO_2_1_stdout_;
extern struct _IO_FILE_plus _IO_2_1_stderr_;
# 337 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
typedef __ssize_t __io_read_fn (void *__cookie, char *__buf, size_t __nbytes);
typedef __ssize_t __io_write_fn (void *__cookie, const char *__buf,
size_t __n);
typedef int __io_seek_fn (void *__cookie, __off64_t *__pos, int __w);
typedef int __io_close_fn (void *__cookie);
# 389 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
extern int __underflow (_IO_FILE *);
extern int __uflow (_IO_FILE *);
extern int __overflow (_IO_FILE *, int);
# 433 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
extern int _IO_getc (_IO_FILE *__fp);
extern int _IO_putc (int __c, _IO_FILE *__fp);
extern int _IO_feof (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
extern int _IO_ferror (_IO_FILE *__fp) __attribute__ ((__nothrow__ , __leaf__));
extern int _IO_peekc_locked (_IO_FILE *__fp);
extern void _IO_flockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
extern void _IO_funlockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
extern int _IO_ftrylockfile (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
# 462 "/usr/include/x86_64-linux-gnu/bits/libio.h" 3 4
extern int _IO_vfscanf (_IO_FILE * __restrict, const char * __restrict,
__gnuc_va_list, int *__restrict);
extern int _IO_vfprintf (_IO_FILE *__restrict, const char *__restrict,
__gnuc_va_list);
extern __ssize_t _IO_padn (_IO_FILE *, int, __ssize_t);
extern size_t _IO_sgetn (_IO_FILE *, void *, size_t);
extern __off64_t _IO_seekoff (_IO_FILE *, __off64_t, int, int);
extern __off64_t _IO_seekpos (_IO_FILE *, __off64_t, int);
extern void _IO_free_backup_area (_IO_FILE *) __attribute__ ((__nothrow__ , __leaf__));
# 42 "/usr/include/stdio.h" 2 3 4
typedef __gnuc_va_list va_list;
# 78 "/usr/include/stdio.h" 3 4
typedef _G_fpos_t fpos_t;
# 131 "/usr/include/stdio.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stdio_lim.h" 1 3 4
# 132 "/usr/include/stdio.h" 2 3 4
extern struct _IO_FILE *stdin;
extern struct _IO_FILE *stdout;
extern struct _IO_FILE *stderr;
extern int remove (const char *__filename) __attribute__ ((__nothrow__ , __leaf__));
extern int rename (const char *__old, const char *__new) __attribute__ ((__nothrow__ , __leaf__));
extern int renameat (int __oldfd, const char *__old, int __newfd,
const char *__new) __attribute__ ((__nothrow__ , __leaf__));
extern FILE *tmpfile (void) ;
# 173 "/usr/include/stdio.h" 3 4
extern char *tmpnam (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
extern char *tmpnam_r (char *__s) __attribute__ ((__nothrow__ , __leaf__)) ;
# 190 "/usr/include/stdio.h" 3 4
extern char *tempnam (const char *__dir, const char *__pfx)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) ;
extern int fclose (FILE *__stream);
extern int fflush (FILE *__stream);
# 213 "/usr/include/stdio.h" 3 4
extern int fflush_unlocked (FILE *__stream);
# 232 "/usr/include/stdio.h" 3 4
extern FILE *fopen (const char *__restrict __filename,
const char *__restrict __modes) ;
extern FILE *freopen (const char *__restrict __filename,
const char *__restrict __modes,
FILE *__restrict __stream) ;
# 265 "/usr/include/stdio.h" 3 4
extern FILE *fdopen (int __fd, const char *__modes) __attribute__ ((__nothrow__ , __leaf__)) ;
# 278 "/usr/include/stdio.h" 3 4
extern FILE *fmemopen (void *__s, size_t __len, const char *__modes)
__attribute__ ((__nothrow__ , __leaf__)) ;
extern FILE *open_memstream (char **__bufloc, size_t *__sizeloc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void setbuf (FILE *__restrict __stream, char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern int setvbuf (FILE *__restrict __stream, char *__restrict __buf,
int __modes, size_t __n) __attribute__ ((__nothrow__ , __leaf__));
extern void setbuffer (FILE *__restrict __stream, char *__restrict __buf,
size_t __size) __attribute__ ((__nothrow__ , __leaf__));
extern void setlinebuf (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int fprintf (FILE *__restrict __stream,
const char *__restrict __format, ...);
extern int printf (const char *__restrict __format, ...);
extern int sprintf (char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__));
extern int vfprintf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg);
extern int vprintf (const char *__restrict __format, __gnuc_va_list __arg);
extern int vsprintf (char *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg) __attribute__ ((__nothrow__));
extern int snprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, ...)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 4)));
extern int vsnprintf (char *__restrict __s, size_t __maxlen,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__)) __attribute__ ((__format__ (__printf__, 3, 0)));
# 365 "/usr/include/stdio.h" 3 4
extern int vdprintf (int __fd, const char *__restrict __fmt,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__printf__, 2, 0)));
extern int dprintf (int __fd, const char *__restrict __fmt, ...)
__attribute__ ((__format__ (__printf__, 2, 3)));
extern int fscanf (FILE *__restrict __stream,
const char *__restrict __format, ...) ;
extern int scanf (const char *__restrict __format, ...) ;
extern int sscanf (const char *__restrict __s,
const char *__restrict __format, ...) __attribute__ ((__nothrow__ , __leaf__));
# 395 "/usr/include/stdio.h" 3 4
extern int fscanf (FILE *__restrict __stream, const char *__restrict __format, ...) __asm__ ("" "__isoc99_fscanf")
;
extern int scanf (const char *__restrict __format, ...) __asm__ ("" "__isoc99_scanf")
;
extern int sscanf (const char *__restrict __s, const char *__restrict __format, ...) __asm__ ("" "__isoc99_sscanf") __attribute__ ((__nothrow__ , __leaf__))
;
# 420 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format,
__gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s,
const char *__restrict __format, __gnuc_va_list __arg)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__format__ (__scanf__, 2, 0)));
# 443 "/usr/include/stdio.h" 3 4
extern int vfscanf (FILE *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vfscanf")
__attribute__ ((__format__ (__scanf__, 2, 0))) ;
extern int vscanf (const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vscanf")
__attribute__ ((__format__ (__scanf__, 1, 0))) ;
extern int vsscanf (const char *__restrict __s, const char *__restrict __format, __gnuc_va_list __arg) __asm__ ("" "__isoc99_vsscanf") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__format__ (__scanf__, 2, 0)));
# 477 "/usr/include/stdio.h" 3 4
extern int fgetc (FILE *__stream);
extern int getc (FILE *__stream);
extern int getchar (void);
# 495 "/usr/include/stdio.h" 3 4
extern int getc_unlocked (FILE *__stream);
extern int getchar_unlocked (void);
# 506 "/usr/include/stdio.h" 3 4
extern int fgetc_unlocked (FILE *__stream);
# 517 "/usr/include/stdio.h" 3 4
extern int fputc (int __c, FILE *__stream);
extern int putc (int __c, FILE *__stream);
extern int putchar (int __c);
# 537 "/usr/include/stdio.h" 3 4
extern int fputc_unlocked (int __c, FILE *__stream);
extern int putc_unlocked (int __c, FILE *__stream);
extern int putchar_unlocked (int __c);
extern int getw (FILE *__stream);
extern int putw (int __w, FILE *__stream);
extern char *fgets (char *__restrict __s, int __n, FILE *__restrict __stream)
;
# 603 "/usr/include/stdio.h" 3 4
extern __ssize_t __getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getdelim (char **__restrict __lineptr,
size_t *__restrict __n, int __delimiter,
FILE *__restrict __stream) ;
extern __ssize_t getline (char **__restrict __lineptr,
size_t *__restrict __n,
FILE *__restrict __stream) ;
extern int fputs (const char *__restrict __s, FILE *__restrict __stream);
extern int puts (const char *__s);
extern int ungetc (int __c, FILE *__stream);
extern size_t fread (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __s);
# 673 "/usr/include/stdio.h" 3 4
extern size_t fread_unlocked (void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream) ;
extern size_t fwrite_unlocked (const void *__restrict __ptr, size_t __size,
size_t __n, FILE *__restrict __stream);
extern int fseek (FILE *__stream, long int __off, int __whence);
extern long int ftell (FILE *__stream) ;
extern void rewind (FILE *__stream);
# 707 "/usr/include/stdio.h" 3 4
extern int fseeko (FILE *__stream, __off_t __off, int __whence);
extern __off_t ftello (FILE *__stream) ;
# 731 "/usr/include/stdio.h" 3 4
extern int fgetpos (FILE *__restrict __stream, fpos_t *__restrict __pos);
extern int fsetpos (FILE *__stream, const fpos_t *__pos);
# 757 "/usr/include/stdio.h" 3 4
extern void clearerr (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void clearerr_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int feof_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int ferror_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void perror (const char *__s);
# 1 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/sys_errlist.h" 3 4
extern int sys_nerr;
extern const char *const sys_errlist[];
# 782 "/usr/include/stdio.h" 2 3 4
extern int fileno (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int fileno_unlocked (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
# 800 "/usr/include/stdio.h" 3 4
extern FILE *popen (const char *__command, const char *__modes) ;
extern int pclose (FILE *__stream);
extern char *ctermid (char *__s) __attribute__ ((__nothrow__ , __leaf__));
# 840 "/usr/include/stdio.h" 3 4
extern void flockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
extern int ftrylockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void funlockfile (FILE *__stream) __attribute__ ((__nothrow__ , __leaf__));
# 868 "/usr/include/stdio.h" 3 4
# 21 "alloc-inl.h" 2
# 1 "/usr/include/string.h" 1 3 4
# 26 "/usr/include/string.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/libc-header-start.h" 1 3 4
# 27 "/usr/include/string.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 34 "/usr/include/string.h" 2 3 4
# 42 "/usr/include/string.h" 3 4
extern void *memcpy (void *__restrict __dest, const void *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memmove (void *__dest, const void *__src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memccpy (void *__restrict __dest, const void *__restrict __src,
int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void *memset (void *__s, int __c, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int memcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 90 "/usr/include/string.h" 3 4
extern void *memchr (const void *__s, int __c, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 121 "/usr/include/string.h" 3 4
extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strcat (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strncat (char *__restrict __dest, const char *__restrict __src,
size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcoll (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strxfrm (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 1 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/types/__locale_t.h" 3 4
struct __locale_struct
{
struct __locale_data *__locales[13];
const unsigned short int *__ctype_b;
const int *__ctype_tolower;
const int *__ctype_toupper;
const char *__names[13];
};
typedef struct __locale_struct *__locale_t;
# 23 "/usr/include/x86_64-linux-gnu/bits/types/locale_t.h" 2 3 4
typedef __locale_t locale_t;
# 153 "/usr/include/string.h" 2 3 4
extern int strcoll_l (const char *__s1, const char *__s2, locale_t __l)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern size_t strxfrm_l (char *__dest, const char *__src, size_t __n,
locale_t __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern char *strdup (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
extern char *strndup (const char *__string, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__malloc__)) __attribute__ ((__nonnull__ (1)));
# 225 "/usr/include/string.h" 3 4
extern char *strchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 252 "/usr/include/string.h" 3 4
extern char *strrchr (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 272 "/usr/include/string.h" 3 4
extern size_t strcspn (const char *__s, const char *__reject)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern size_t strspn (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 302 "/usr/include/string.h" 3 4
extern char *strpbrk (const char *__s, const char *__accept)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 329 "/usr/include/string.h" 3 4
extern char *strstr (const char *__haystack, const char *__needle)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strtok (char *__restrict __s, const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern char *__strtok_r (char *__restrict __s,
const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern char *strtok_r (char *__restrict __s, const char *__restrict __delim,
char **__restrict __save_ptr)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 384 "/usr/include/string.h" 3 4
extern size_t strlen (const char *__s)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern size_t strnlen (const char *__string, size_t __maxlen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern char *strerror (int __errnum) __attribute__ ((__nothrow__ , __leaf__));
# 409 "/usr/include/string.h" 3 4
extern int strerror_r (int __errnum, char *__buf, size_t __buflen) __asm__ ("" "__xpg_strerror_r") __attribute__ ((__nothrow__ , __leaf__))
__attribute__ ((__nonnull__ (2)));
# 427 "/usr/include/string.h" 3 4
extern char *strerror_l (int __errnum, locale_t __l) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/strings.h" 1 3 4
# 23 "/usr/include/strings.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 24 "/usr/include/strings.h" 2 3 4
extern int bcmp (const void *__s1, const void *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bcopy (const void *__src, void *__dest, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern void bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 68 "/usr/include/strings.h" 3 4
extern char *index (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
# 96 "/usr/include/strings.h" 3 4
extern char *rindex (const char *__s, int __c)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1)));
extern int ffs (int __i) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int ffsl (long int __l) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
__extension__ extern int ffsll (long long int __ll)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int strcasecmp (const char *__s1, const char *__s2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strncasecmp (const char *__s1, const char *__s2, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
extern int strcasecmp_l (const char *__s1, const char *__s2, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 3)));
extern int strncasecmp_l (const char *__s1, const char *__s2,
size_t __n, locale_t __loc)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2, 4)));
# 432 "/usr/include/string.h" 2 3 4
extern void explicit_bzero (void *__s, size_t __n) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern char *strsep (char **__restrict __stringp,
const char *__restrict __delim)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *strsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern char *__stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpcpy (char *__restrict __dest, const char *__restrict __src)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *__stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern char *stpncpy (char *__restrict __dest,
const char *__restrict __src, size_t __n)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 498 "/usr/include/string.h" 3 4
# 23 "alloc-inl.h" 2
# 64 "alloc-inl.h"
# 64 "alloc-inl.h"
static inline void* DFL_ck_alloc(u32 size) {
void* ret;
if (!size) return
# 67 "alloc-inl.h" 3 4
((void *)0)
# 67 "alloc-inl.h"
;
do { if ((size) > 0x40000000) do { fprintf(
# 69 "alloc-inl.h" 3 4
stderr
# 69 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (size)); fprintf(
# 69 "alloc-inl.h" 3 4
stderr
# 69 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 69); abort(); } while (0); } while (0);
ret = malloc(size + 6);
do { if (!(ret)) do { fprintf(
# 71 "alloc-inl.h" 3 4
stderr
# 71 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Out of memory: can't allocate %u bytes", (size)); fprintf(
# 71 "alloc-inl.h" 3 4
stderr
# 71 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 71); abort(); } while (0); } while (0);
ret += 6;
(((u16*)(ret))[-3]) = 0xFF00;
(((u32*)(ret))[-1]) = size;
return memset(ret, 0, size);
}
static inline void* DFL_ck_realloc(void* orig, u32 size) {
void* ret;
u32 old_size = 0;
if (!size) {
if (orig) {
do { if ((orig) && (((u16*)(orig))[-3]) != 0xFF00) { if ((((u16*)(orig))[-3]) == 0xFE00) do { fprintf(
# 90 "alloc-inl.h" 3 4
stderr
# 90 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Use after free."); fprintf(
# 90 "alloc-inl.h" 3 4
stderr
# 90 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 90); abort(); } while (0); else do { fprintf(
# 90 "alloc-inl.h" 3 4
stderr
# 90 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc canary."); fprintf(
# 90 "alloc-inl.h" 3 4
stderr
# 90 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 90); abort(); } while (0); } } while (0);
free(orig - 6);
}
return
# 102 "alloc-inl.h" 3 4
((void *)0)
# 102 "alloc-inl.h"
;
}
if (orig) {
do { if ((orig) && (((u16*)(orig))[-3]) != 0xFF00) { if ((((u16*)(orig))[-3]) == 0xFE00) do { fprintf(
# 108 "alloc-inl.h" 3 4
stderr
# 108 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Use after free."); fprintf(
# 108 "alloc-inl.h" 3 4
stderr
# 108 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 108); abort(); } while (0); else do { fprintf(
# 108 "alloc-inl.h" 3 4
stderr
# 108 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc canary."); fprintf(
# 108 "alloc-inl.h" 3 4
stderr
# 108 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 108); abort(); } while (0); } } while (0);
(((u16*)(orig))[-3]) = 0xFE00;
old_size = (((u32*)(orig))[-1]);
orig -= 6;
do { if ((old_size) > 0x40000000) do { fprintf(
# 117 "alloc-inl.h" 3 4
stderr
# 117 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (old_size)); fprintf(
# 117 "alloc-inl.h" 3 4
stderr
# 117 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 117); abort(); } while (0); } while (0);
}
do { if ((size) > 0x40000000) do { fprintf(
# 121 "alloc-inl.h" 3 4
stderr
# 121 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (size)); fprintf(
# 121 "alloc-inl.h" 3 4
stderr
# 121 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 121); abort(); } while (0); } while (0);
ret = realloc(orig, size + 6);
do { if (!(ret)) do { fprintf(
# 126 "alloc-inl.h" 3 4
stderr
# 126 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Out of memory: can't allocate %u bytes", (size)); fprintf(
# 126 "alloc-inl.h" 3 4
stderr
# 126 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 126); abort(); } while (0); } while (0);
# 149 "alloc-inl.h"
ret += 6;
(((u16*)(ret))[-3]) = 0xFF00;
(((u32*)(ret))[-1]) = size;
if (size > old_size)
memset(ret + old_size, 0, size - old_size);
return ret;
}
static inline void* DFL_ck_realloc_chunk(void* orig, u32 size) {
if (orig) {
do { if ((orig) && (((u16*)(orig))[-3]) != 0xFF00) { if ((((u16*)(orig))[-3]) == 0xFE00) do { fprintf(
# 167 "alloc-inl.h" 3 4
stderr
# 167 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Use after free."); fprintf(
# 167 "alloc-inl.h" 3 4
stderr
# 167 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 167); abort(); } while (0); else do { fprintf(
# 167 "alloc-inl.h" 3 4
stderr
# 167 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc canary."); fprintf(
# 167 "alloc-inl.h" 3 4
stderr
# 167 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 167); abort(); } while (0); } } while (0);
if ((((u32*)(orig))[-1]) >= size) return orig;
size += 256;
}
return DFL_ck_realloc(orig, size);
}
static inline u8* DFL_ck_strdup(u8* str) {
void* ret;
u32 size;
if (!str) return
# 185 "alloc-inl.h" 3 4
((void *)0)
# 185 "alloc-inl.h"
;
size = strlen((char*)str) + 1;
do { if ((size) > 0x40000000) do { fprintf(
# 189 "alloc-inl.h" 3 4
stderr
# 189 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (size)); fprintf(
# 189 "alloc-inl.h" 3 4
stderr
# 189 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 189); abort(); } while (0); } while (0);
ret = malloc(size + 6);
do { if (!(ret)) do { fprintf(
# 191 "alloc-inl.h" 3 4
stderr
# 191 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Out of memory: can't allocate %u bytes", (size)); fprintf(
# 191 "alloc-inl.h" 3 4
stderr
# 191 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 191); abort(); } while (0); } while (0);
ret += 6;
(((u16*)(ret))[-3]) = 0xFF00;
(((u32*)(ret))[-1]) = size;
return memcpy(ret, str, size);
}
static inline void* DFL_ck_memdup(void* mem, u32 size) {
void* ret;
if (!mem || !size) return
# 205 "alloc-inl.h" 3 4
((void *)0)
# 205 "alloc-inl.h"
;
do { if ((size) > 0x40000000) do { fprintf(
# 207 "alloc-inl.h" 3 4
stderr
# 207 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (size)); fprintf(
# 207 "alloc-inl.h" 3 4
stderr
# 207 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 207); abort(); } while (0); } while (0);
ret = malloc(size + 6);
do { if (!(ret)) do { fprintf(
# 209 "alloc-inl.h" 3 4
stderr
# 209 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Out of memory: can't allocate %u bytes", (size)); fprintf(
# 209 "alloc-inl.h" 3 4
stderr
# 209 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 209); abort(); } while (0); } while (0);
ret += 6;
(((u16*)(ret))[-3]) = 0xFF00;
(((u32*)(ret))[-1]) = size;
return memcpy(ret, mem, size);
}
static inline u8* DFL_ck_memdup_str(u8* mem, u32 size) {
u8* ret;
if (!mem || !size) return
# 223 "alloc-inl.h" 3 4
((void *)0)
# 223 "alloc-inl.h"
;
do { if ((size) > 0x40000000) do { fprintf(
# 225 "alloc-inl.h" 3 4
stderr
# 225 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc request: %u bytes", (size)); fprintf(
# 225 "alloc-inl.h" 3 4
stderr
# 225 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 225); abort(); } while (0); } while (0);
ret = malloc(size + 6 + 1);
do { if (!(ret)) do { fprintf(
# 227 "alloc-inl.h" 3 4
stderr
# 227 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Out of memory: can't allocate %u bytes", (size)); fprintf(
# 227 "alloc-inl.h" 3 4
stderr
# 227 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 227); abort(); } while (0); } while (0);
ret += 6;
(((u16*)(ret))[-3]) = 0xFF00;
(((u32*)(ret))[-1]) = size;
memcpy(ret, mem, size);
ret[size] = 0;
return ret;
}
static inline void DFL_ck_free(void* mem) {
if (mem) {
do { if ((mem) && (((u16*)(mem))[-3]) != 0xFF00) { if ((((u16*)(mem))[-3]) == 0xFE00) do { fprintf(
# 245 "alloc-inl.h" 3 4
stderr
# 245 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Use after free."); fprintf(
# 245 "alloc-inl.h" 3 4
stderr
# 245 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 245); abort(); } while (0); else do { fprintf(
# 245 "alloc-inl.h" 3 4
stderr
# 245 "alloc-inl.h"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad alloc canary."); fprintf(
# 245 "alloc-inl.h" 3 4
stderr
# 245 "alloc-inl.h"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "alloc-inl.h", 245); abort(); } while (0); } } while (0);
# 254 "alloc-inl.h"
(((u16*)(mem))[-3]) = 0xFE00;
free(mem - 6);
}
}
# 27 "afl-fuzz-single.c" 2
# 1 "/usr/include/unistd.h" 1 3 4
# 27 "/usr/include/unistd.h" 3 4
# 205 "/usr/include/unistd.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix_opt.h" 1 3 4
# 206 "/usr/include/unistd.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/environments.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/environments.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/environments.h" 2 3 4
# 210 "/usr/include/unistd.h" 2 3 4
# 229 "/usr/include/unistd.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 230 "/usr/include/unistd.h" 2 3 4
# 258 "/usr/include/unistd.h" 3 4
# 258 "/usr/include/unistd.h" 3 4
typedef __useconds_t useconds_t;
# 277 "/usr/include/unistd.h" 3 4
typedef __socklen_t socklen_t;
# 290 "/usr/include/unistd.h" 3 4
extern int access (const char *__name, int __type) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 307 "/usr/include/unistd.h" 3 4
extern int faccessat (int __fd, const char *__file, int __type, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
# 337 "/usr/include/unistd.h" 3 4
extern __off_t lseek (int __fd, __off_t __offset, int __whence) __attribute__ ((__nothrow__ , __leaf__));
# 356 "/usr/include/unistd.h" 3 4
extern int close (int __fd);
extern ssize_t read (int __fd, void *__buf, size_t __nbytes) ;
extern ssize_t write (int __fd, const void *__buf, size_t __n) ;
# 379 "/usr/include/unistd.h" 3 4
extern ssize_t pread (int __fd, void *__buf, size_t __nbytes,
__off_t __offset) ;
extern ssize_t pwrite (int __fd, const void *__buf, size_t __n,
__off_t __offset) ;
# 420 "/usr/include/unistd.h" 3 4
extern int pipe (int __pipedes[2]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 435 "/usr/include/unistd.h" 3 4
extern unsigned int alarm (unsigned int __seconds) __attribute__ ((__nothrow__ , __leaf__));
# 447 "/usr/include/unistd.h" 3 4
extern unsigned int sleep (unsigned int __seconds);
extern __useconds_t ualarm (__useconds_t __value, __useconds_t __interval)
__attribute__ ((__nothrow__ , __leaf__));
extern int usleep (__useconds_t __useconds);
# 472 "/usr/include/unistd.h" 3 4
extern int pause (void);
extern int chown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchown (int __fd, __uid_t __owner, __gid_t __group) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int lchown (const char *__file, __uid_t __owner, __gid_t __group)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchownat (int __fd, const char *__file, __uid_t __owner,
__gid_t __group, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int chdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int fchdir (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
# 514 "/usr/include/unistd.h" 3 4
extern char *getcwd (char *__buf, size_t __size) __attribute__ ((__nothrow__ , __leaf__)) ;
# 528 "/usr/include/unistd.h" 3 4
extern char *getwd (char *__buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__)) ;
extern int dup (int __fd) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int dup2 (int __fd, int __fd2) __attribute__ ((__nothrow__ , __leaf__));
# 546 "/usr/include/unistd.h" 3 4
extern char **__environ;
extern int execve (const char *__path, char *const __argv[],
char *const __envp[]) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fexecve (int __fd, char *const __argv[], char *const __envp[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int execv (const char *__path, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execle (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execl (const char *__path, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execvp (const char *__file, char *const __argv[])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int execlp (const char *__file, const char *__arg, ...)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 601 "/usr/include/unistd.h" 3 4
extern int nice (int __inc) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void _exit (int __status) __attribute__ ((__noreturn__));
# 1 "/usr/include/x86_64-linux-gnu/bits/confname.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/confname.h" 3 4
enum
{
_PC_LINK_MAX,
_PC_MAX_CANON,
_PC_MAX_INPUT,
_PC_NAME_MAX,
_PC_PATH_MAX,
_PC_PIPE_BUF,
_PC_CHOWN_RESTRICTED,
_PC_NO_TRUNC,
_PC_VDISABLE,
_PC_SYNC_IO,
_PC_ASYNC_IO,
_PC_PRIO_IO,
_PC_SOCK_MAXBUF,
_PC_FILESIZEBITS,
_PC_REC_INCR_XFER_SIZE,
_PC_REC_MAX_XFER_SIZE,
_PC_REC_MIN_XFER_SIZE,
_PC_REC_XFER_ALIGN,
_PC_ALLOC_SIZE_MIN,
_PC_SYMLINK_MAX,
_PC_2_SYMLINKS
};
enum
{
_SC_ARG_MAX,
_SC_CHILD_MAX,
_SC_CLK_TCK,
_SC_NGROUPS_MAX,
_SC_OPEN_MAX,
_SC_STREAM_MAX,
_SC_TZNAME_MAX,
_SC_JOB_CONTROL,
_SC_SAVED_IDS,
_SC_REALTIME_SIGNALS,
_SC_PRIORITY_SCHEDULING,
_SC_TIMERS,
_SC_ASYNCHRONOUS_IO,
_SC_PRIORITIZED_IO,
_SC_SYNCHRONIZED_IO,
_SC_FSYNC,
_SC_MAPPED_FILES,
_SC_MEMLOCK,
_SC_MEMLOCK_RANGE,
_SC_MEMORY_PROTECTION,
_SC_MESSAGE_PASSING,
_SC_SEMAPHORES,
_SC_SHARED_MEMORY_OBJECTS,
_SC_AIO_LISTIO_MAX,
_SC_AIO_MAX,
_SC_AIO_PRIO_DELTA_MAX,
_SC_DELAYTIMER_MAX,
_SC_MQ_OPEN_MAX,
_SC_MQ_PRIO_MAX,
_SC_VERSION,
_SC_PAGESIZE,
_SC_RTSIG_MAX,
_SC_SEM_NSEMS_MAX,
_SC_SEM_VALUE_MAX,
_SC_SIGQUEUE_MAX,
_SC_TIMER_MAX,
_SC_BC_BASE_MAX,
_SC_BC_DIM_MAX,
_SC_BC_SCALE_MAX,
_SC_BC_STRING_MAX,
_SC_COLL_WEIGHTS_MAX,
_SC_EQUIV_CLASS_MAX,
_SC_EXPR_NEST_MAX,
_SC_LINE_MAX,
_SC_RE_DUP_MAX,
_SC_CHARCLASS_NAME_MAX,
_SC_2_VERSION,
_SC_2_C_BIND,
_SC_2_C_DEV,
_SC_2_FORT_DEV,
_SC_2_FORT_RUN,
_SC_2_SW_DEV,
_SC_2_LOCALEDEF,
_SC_PII,
_SC_PII_XTI,
_SC_PII_SOCKET,
_SC_PII_INTERNET,
_SC_PII_OSI,
_SC_POLL,
_SC_SELECT,
_SC_UIO_MAXIOV,
_SC_IOV_MAX = _SC_UIO_MAXIOV,
_SC_PII_INTERNET_STREAM,
_SC_PII_INTERNET_DGRAM,
_SC_PII_OSI_COTS,
_SC_PII_OSI_CLTS,
_SC_PII_OSI_M,
_SC_T_IOV_MAX,
_SC_THREADS,
_SC_THREAD_SAFE_FUNCTIONS,
_SC_GETGR_R_SIZE_MAX,
_SC_GETPW_R_SIZE_MAX,
_SC_LOGIN_NAME_MAX,
_SC_TTY_NAME_MAX,
_SC_THREAD_DESTRUCTOR_ITERATIONS,
_SC_THREAD_KEYS_MAX,
_SC_THREAD_STACK_MIN,
_SC_THREAD_THREADS_MAX,
_SC_THREAD_ATTR_STACKADDR,
_SC_THREAD_ATTR_STACKSIZE,
_SC_THREAD_PRIORITY_SCHEDULING,
_SC_THREAD_PRIO_INHERIT,
_SC_THREAD_PRIO_PROTECT,
_SC_THREAD_PROCESS_SHARED,
_SC_NPROCESSORS_CONF,
_SC_NPROCESSORS_ONLN,
_SC_PHYS_PAGES,
_SC_AVPHYS_PAGES,
_SC_ATEXIT_MAX,
_SC_PASS_MAX,
_SC_XOPEN_VERSION,
_SC_XOPEN_XCU_VERSION,
_SC_XOPEN_UNIX,
_SC_XOPEN_CRYPT,
_SC_XOPEN_ENH_I18N,
_SC_XOPEN_SHM,
_SC_2_CHAR_TERM,
_SC_2_C_VERSION,
_SC_2_UPE,
_SC_XOPEN_XPG2,
_SC_XOPEN_XPG3,
_SC_XOPEN_XPG4,
_SC_CHAR_BIT,
_SC_CHAR_MAX,
_SC_CHAR_MIN,
_SC_INT_MAX,
_SC_INT_MIN,
_SC_LONG_BIT,
_SC_WORD_BIT,
_SC_MB_LEN_MAX,
_SC_NZERO,
_SC_SSIZE_MAX,
_SC_SCHAR_MAX,
_SC_SCHAR_MIN,
_SC_SHRT_MAX,
_SC_SHRT_MIN,
_SC_UCHAR_MAX,
_SC_UINT_MAX,
_SC_ULONG_MAX,
_SC_USHRT_MAX,
_SC_NL_ARGMAX,
_SC_NL_LANGMAX,
_SC_NL_MSGMAX,
_SC_NL_NMAX,
_SC_NL_SETMAX,
_SC_NL_TEXTMAX,
_SC_XBS5_ILP32_OFF32,
_SC_XBS5_ILP32_OFFBIG,
_SC_XBS5_LP64_OFF64,
_SC_XBS5_LPBIG_OFFBIG,
_SC_XOPEN_LEGACY,
_SC_XOPEN_REALTIME,
_SC_XOPEN_REALTIME_THREADS,
_SC_ADVISORY_INFO,
_SC_BARRIERS,
_SC_BASE,
_SC_C_LANG_SUPPORT,
_SC_C_LANG_SUPPORT_R,
_SC_CLOCK_SELECTION,
_SC_CPUTIME,
_SC_THREAD_CPUTIME,
_SC_DEVICE_IO,
_SC_DEVICE_SPECIFIC,
_SC_DEVICE_SPECIFIC_R,
_SC_FD_MGMT,
_SC_FIFO,
_SC_PIPE,
_SC_FILE_ATTRIBUTES,
_SC_FILE_LOCKING,
_SC_FILE_SYSTEM,
_SC_MONOTONIC_CLOCK,
_SC_MULTI_PROCESS,
_SC_SINGLE_PROCESS,
_SC_NETWORKING,
_SC_READER_WRITER_LOCKS,
_SC_SPIN_LOCKS,
_SC_REGEXP,
_SC_REGEX_VERSION,
_SC_SHELL,
_SC_SIGNALS,
_SC_SPAWN,
_SC_SPORADIC_SERVER,
_SC_THREAD_SPORADIC_SERVER,
_SC_SYSTEM_DATABASE,
_SC_SYSTEM_DATABASE_R,
_SC_TIMEOUTS,
_SC_TYPED_MEMORY_OBJECTS,
_SC_USER_GROUPS,
_SC_USER_GROUPS_R,
_SC_2_PBS,
_SC_2_PBS_ACCOUNTING,
_SC_2_PBS_LOCATE,
_SC_2_PBS_MESSAGE,
_SC_2_PBS_TRACK,
_SC_SYMLOOP_MAX,
_SC_STREAMS,
_SC_2_PBS_CHECKPOINT,
_SC_V6_ILP32_OFF32,
_SC_V6_ILP32_OFFBIG,
_SC_V6_LP64_OFF64,
_SC_V6_LPBIG_OFFBIG,
_SC_HOST_NAME_MAX,
_SC_TRACE,
_SC_TRACE_EVENT_FILTER,
_SC_TRACE_INHERIT,
_SC_TRACE_LOG,
_SC_LEVEL1_ICACHE_SIZE,
_SC_LEVEL1_ICACHE_ASSOC,
_SC_LEVEL1_ICACHE_LINESIZE,
_SC_LEVEL1_DCACHE_SIZE,
_SC_LEVEL1_DCACHE_ASSOC,
_SC_LEVEL1_DCACHE_LINESIZE,
_SC_LEVEL2_CACHE_SIZE,
_SC_LEVEL2_CACHE_ASSOC,
_SC_LEVEL2_CACHE_LINESIZE,
_SC_LEVEL3_CACHE_SIZE,
_SC_LEVEL3_CACHE_ASSOC,
_SC_LEVEL3_CACHE_LINESIZE,
_SC_LEVEL4_CACHE_SIZE,
_SC_LEVEL4_CACHE_ASSOC,
_SC_LEVEL4_CACHE_LINESIZE,
_SC_IPV6 = _SC_LEVEL1_ICACHE_SIZE + 50,
_SC_RAW_SOCKETS,
_SC_V7_ILP32_OFF32,
_SC_V7_ILP32_OFFBIG,
_SC_V7_LP64_OFF64,
_SC_V7_LPBIG_OFFBIG,
_SC_SS_REPL_MAX,
_SC_TRACE_EVENT_NAME_MAX,
_SC_TRACE_NAME_MAX,
_SC_TRACE_SYS_MAX,
_SC_TRACE_USER_EVENT_MAX,
_SC_XOPEN_STREAMS,
_SC_THREAD_ROBUST_PRIO_INHERIT,
_SC_THREAD_ROBUST_PRIO_PROTECT
};
enum
{
_CS_PATH,
_CS_V6_WIDTH_RESTRICTED_ENVS,
_CS_GNU_LIBC_VERSION,
_CS_GNU_LIBPTHREAD_VERSION,
_CS_V5_WIDTH_RESTRICTED_ENVS,
_CS_V7_WIDTH_RESTRICTED_ENVS,
_CS_LFS_CFLAGS = 1000,
_CS_LFS_LDFLAGS,
_CS_LFS_LIBS,
_CS_LFS_LINTFLAGS,
_CS_LFS64_CFLAGS,
_CS_LFS64_LDFLAGS,
_CS_LFS64_LIBS,
_CS_LFS64_LINTFLAGS,
_CS_XBS5_ILP32_OFF32_CFLAGS = 1100,
_CS_XBS5_ILP32_OFF32_LDFLAGS,
_CS_XBS5_ILP32_OFF32_LIBS,
_CS_XBS5_ILP32_OFF32_LINTFLAGS,
_CS_XBS5_ILP32_OFFBIG_CFLAGS,
_CS_XBS5_ILP32_OFFBIG_LDFLAGS,
_CS_XBS5_ILP32_OFFBIG_LIBS,
_CS_XBS5_ILP32_OFFBIG_LINTFLAGS,
_CS_XBS5_LP64_OFF64_CFLAGS,
_CS_XBS5_LP64_OFF64_LDFLAGS,
_CS_XBS5_LP64_OFF64_LIBS,
_CS_XBS5_LP64_OFF64_LINTFLAGS,
_CS_XBS5_LPBIG_OFFBIG_CFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LDFLAGS,
_CS_XBS5_LPBIG_OFFBIG_LIBS,
_CS_XBS5_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFF32_CFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V6_ILP32_OFF32_LIBS,
_CS_POSIX_V6_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V6_ILP32_OFFBIG_LIBS,
_CS_POSIX_V6_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V6_LP64_OFF64_CFLAGS,
_CS_POSIX_V6_LP64_OFF64_LDFLAGS,
_CS_POSIX_V6_LP64_OFF64_LIBS,
_CS_POSIX_V6_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V6_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V6_LPBIG_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFF32_CFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LDFLAGS,
_CS_POSIX_V7_ILP32_OFF32_LIBS,
_CS_POSIX_V7_ILP32_OFF32_LINTFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_CFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LDFLAGS,
_CS_POSIX_V7_ILP32_OFFBIG_LIBS,
_CS_POSIX_V7_ILP32_OFFBIG_LINTFLAGS,
_CS_POSIX_V7_LP64_OFF64_CFLAGS,
_CS_POSIX_V7_LP64_OFF64_LDFLAGS,
_CS_POSIX_V7_LP64_OFF64_LIBS,
_CS_POSIX_V7_LP64_OFF64_LINTFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_CFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LDFLAGS,
_CS_POSIX_V7_LPBIG_OFFBIG_LIBS,
_CS_POSIX_V7_LPBIG_OFFBIG_LINTFLAGS,
_CS_V6_ENV,
_CS_V7_ENV
};
# 613 "/usr/include/unistd.h" 2 3 4
extern long int pathconf (const char *__path, int __name)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int fpathconf (int __fd, int __name) __attribute__ ((__nothrow__ , __leaf__));
extern long int sysconf (int __name) __attribute__ ((__nothrow__ , __leaf__));
extern size_t confstr (int __name, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getppid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t __getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getpgid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern int setpgid (__pid_t __pid, __pid_t __pgid) __attribute__ ((__nothrow__ , __leaf__));
# 663 "/usr/include/unistd.h" 3 4
extern int setpgrp (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t setsid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __pid_t getsid (__pid_t __pid) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t getuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __uid_t geteuid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getgid (void) __attribute__ ((__nothrow__ , __leaf__));
extern __gid_t getegid (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getgroups (int __size, __gid_t __list[]) __attribute__ ((__nothrow__ , __leaf__)) ;
# 703 "/usr/include/unistd.h" 3 4
extern int setuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setreuid (__uid_t __ruid, __uid_t __euid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int seteuid (__uid_t __uid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setgid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setregid (__gid_t __rgid, __gid_t __egid) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int setegid (__gid_t __gid) __attribute__ ((__nothrow__ , __leaf__)) ;
# 759 "/usr/include/unistd.h" 3 4
extern __pid_t fork (void) __attribute__ ((__nothrow__));
extern __pid_t vfork (void) __attribute__ ((__nothrow__ , __leaf__));
extern char *ttyname (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyname_r (int __fd, char *__buf, size_t __buflen)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern int isatty (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int ttyslot (void) __attribute__ ((__nothrow__ , __leaf__));
extern int link (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int linkat (int __fromfd, const char *__from, int __tofd,
const char *__to, int __flags)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4))) ;
extern int symlink (const char *__from, const char *__to)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern ssize_t readlink (const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2))) ;
extern int symlinkat (const char *__from, int __tofd,
const char *__to) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 3))) ;
extern ssize_t readlinkat (int __fd, const char *__restrict __path,
char *__restrict __buf, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3))) ;
extern int unlink (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int unlinkat (int __fd, const char *__name, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int rmdir (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern __pid_t tcgetpgrp (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int tcsetpgrp (int __fd, __pid_t __pgrp_id) __attribute__ ((__nothrow__ , __leaf__));
extern char *getlogin (void);
extern int getlogin_r (char *__name, size_t __name_len) __attribute__ ((__nonnull__ (1)));
extern int setlogin (const char *__name) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern char *optarg;
# 50 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int optind;
extern int opterr;
extern int optopt;
# 91 "/usr/include/x86_64-linux-gnu/bits/getopt_core.h" 3 4
extern int getopt (int ___argc, char *const *___argv, const char *__shortopts)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 28 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 2 3 4
# 49 "/usr/include/x86_64-linux-gnu/bits/getopt_posix.h" 3 4
# 873 "/usr/include/unistd.h" 2 3 4
extern int gethostname (char *__name, size_t __len) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sethostname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int sethostid (long int __id) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int getdomainname (char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int setdomainname (const char *__name, size_t __len)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int vhangup (void) __attribute__ ((__nothrow__ , __leaf__));
extern int revoke (const char *__file) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern int profil (unsigned short int *__sample_buffer, size_t __size,
size_t __offset, unsigned int __scale)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int acct (const char *__name) __attribute__ ((__nothrow__ , __leaf__));
extern char *getusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void endusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern void setusershell (void) __attribute__ ((__nothrow__ , __leaf__));
extern int daemon (int __nochdir, int __noclose) __attribute__ ((__nothrow__ , __leaf__)) ;
extern int chroot (const char *__path) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
extern char *getpass (const char *__prompt) __attribute__ ((__nonnull__ (1)));
extern int fsync (int __fd);
# 970 "/usr/include/unistd.h" 3 4
extern long int gethostid (void);
extern void sync (void) __attribute__ ((__nothrow__ , __leaf__));
extern int getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern int getdtablesize (void) __attribute__ ((__nothrow__ , __leaf__));
# 994 "/usr/include/unistd.h" 3 4
extern int truncate (const char *__file, __off_t __length)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1))) ;
# 1017 "/usr/include/unistd.h" 3 4
extern int ftruncate (int __fd, __off_t __length) __attribute__ ((__nothrow__ , __leaf__)) ;
# 1038 "/usr/include/unistd.h" 3 4
extern int brk (void *__addr) __attribute__ ((__nothrow__ , __leaf__)) ;
extern void *sbrk (intptr_t __delta) __attribute__ ((__nothrow__ , __leaf__));
# 1059 "/usr/include/unistd.h" 3 4
extern long int syscall (long int __sysno, ...) __attribute__ ((__nothrow__ , __leaf__));
# 1082 "/usr/include/unistd.h" 3 4
extern int lockf (int __fd, int __cmd, __off_t __len) ;
# 1118 "/usr/include/unistd.h" 3 4
extern int fdatasync (int __fildes);
# 1167 "/usr/include/unistd.h" 3 4
int getentropy (void *__buffer, size_t __length) ;
# 30 "afl-fuzz-single.c" 2
# 1 "/usr/include/time.h" 1 3 4
# 29 "/usr/include/time.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 30 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/time.h" 1 3 4
# 34 "/usr/include/time.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_tm.h" 1 3 4
struct tm
{
int tm_sec;
int tm_min;
int tm_hour;
int tm_mday;
int tm_mon;
int tm_year;
int tm_wday;
int tm_yday;
int tm_isdst;
long int tm_gmtoff;
const char *tm_zone;
};
# 40 "/usr/include/time.h" 2 3 4
# 48 "/usr/include/time.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_itimerspec.h" 1 3 4
struct itimerspec
{
struct timespec it_interval;
struct timespec it_value;
};
# 49 "/usr/include/time.h" 2 3 4
struct sigevent;
# 68 "/usr/include/time.h" 3 4
extern clock_t clock (void) __attribute__ ((__nothrow__ , __leaf__));
extern time_t time (time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern double difftime (time_t __time1, time_t __time0)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern time_t mktime (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern size_t strftime (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
# 104 "/usr/include/time.h" 3 4
extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
const char *__restrict __format,
const struct tm *__restrict __tp,
locale_t __loc) __attribute__ ((__nothrow__ , __leaf__));
# 119 "/usr/include/time.h" 3 4
extern struct tm *gmtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *localtime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *gmtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
extern struct tm *localtime_r (const time_t *__restrict __timer,
struct tm *__restrict __tp) __attribute__ ((__nothrow__ , __leaf__));
extern char *asctime (const struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern char *ctime (const time_t *__timer) __attribute__ ((__nothrow__ , __leaf__));
extern char *asctime_r (const struct tm *__restrict __tp,
char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern char *ctime_r (const time_t *__restrict __timer,
char *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern char *__tzname[2];
extern int __daylight;
extern long int __timezone;
extern char *tzname[2];
extern void tzset (void) __attribute__ ((__nothrow__ , __leaf__));
extern int daylight;
extern long int timezone;
extern int stime (const time_t *__when) __attribute__ ((__nothrow__ , __leaf__));
# 196 "/usr/include/time.h" 3 4
extern time_t timegm (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern time_t timelocal (struct tm *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern int dysize (int __year) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 211 "/usr/include/time.h" 3 4
extern int nanosleep (const struct timespec *__requested_time,
struct timespec *__remaining);
extern int clock_getres (clockid_t __clock_id, struct timespec *__res) __attribute__ ((__nothrow__ , __leaf__));
extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) __attribute__ ((__nothrow__ , __leaf__));
extern int clock_settime (clockid_t __clock_id, const struct timespec *__tp)
__attribute__ ((__nothrow__ , __leaf__));
extern int clock_nanosleep (clockid_t __clock_id, int __flags,
const struct timespec *__req,
struct timespec *__rem);
extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) __attribute__ ((__nothrow__ , __leaf__));
extern int timer_create (clockid_t __clock_id,
struct sigevent *__restrict __evp,
timer_t *__restrict __timerid) __attribute__ ((__nothrow__ , __leaf__));
extern int timer_delete (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
extern int timer_settime (timer_t __timerid, int __flags,
const struct itimerspec *__restrict __value,
struct itimerspec *__restrict __ovalue) __attribute__ ((__nothrow__ , __leaf__));
extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
__attribute__ ((__nothrow__ , __leaf__));
extern int timer_getoverrun (timer_t __timerid) __attribute__ ((__nothrow__ , __leaf__));
extern int timespec_get (struct timespec *__ts, int __base)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 307 "/usr/include/time.h" 3 4
# 33 "afl-fuzz-single.c" 2
# 1 "/usr/include/errno.h" 1 3 4
# 28 "/usr/include/errno.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/errno.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/errno.h" 3 4
# 1 "/usr/include/linux/errno.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno.h" 1 3 4
# 1 "/usr/include/asm-generic/errno-base.h" 1 3 4
# 6 "/usr/include/asm-generic/errno.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/errno.h" 2 3 4
# 1 "/usr/include/linux/errno.h" 2 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/errno.h" 2 3 4
# 29 "/usr/include/errno.h" 2 3 4
extern int *__errno_location (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 57 "/usr/include/errno.h" 3 4
# 34 "afl-fuzz-single.c" 2
# 1 "/usr/include/signal.h" 1 3 4
# 27 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum.h" 1 3 4
# 26 "/usr/include/x86_64-linux-gnu/bits/signum.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/signum-generic.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/signum.h" 2 3 4
# 31 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sig_atomic_t.h" 1 3 4
typedef __sig_atomic_t sig_atomic_t;
# 33 "/usr/include/signal.h" 2 3 4
# 57 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/__sigval_t.h" 3 4
union sigval
{
int sival_int;
void *sival_ptr;
};
typedef union sigval __sigval_t;
# 7 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-arch.h" 1 3 4
# 17 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 2 3 4
# 36 "/usr/include/x86_64-linux-gnu/bits/types/siginfo_t.h" 3 4
typedef struct
{
int si_signo;
int si_errno;
int si_code;
int __pad0;
union
{
int _pad[((128 / sizeof (int)) - 4)];
struct
{
__pid_t si_pid;
__uid_t si_uid;
} _kill;
struct
{
int si_tid;
int si_overrun;
__sigval_t si_sigval;
} _timer;
struct
{
__pid_t si_pid;
__uid_t si_uid;
__sigval_t si_sigval;
} _rt;
struct
{
__pid_t si_pid;
__uid_t si_uid;
int si_status;
__clock_t si_utime;
__clock_t si_stime;
} _sigchld;
struct
{
void *si_addr;
short int si_addr_lsb;
union
{
struct
{
void *_lower;
void *_upper;
} _addr_bnd;
__uint32_t _pkey;
} _bounds;
} _sigfault;
struct
{
long int si_band;
int si_fd;
} _sigpoll;
struct
{
void *_call_addr;
int _syscall;
unsigned int _arch;
} _sigsys;
} _sifields;
} siginfo_t ;
# 58 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
SI_ASYNCNL = -60,
SI_TKILL = -6,
SI_SIGIO,
SI_ASYNCIO,
SI_MESGQ,
SI_TIMER,
SI_QUEUE,
SI_USER,
SI_KERNEL = 0x80
# 63 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
};
enum
{
ILL_ILLOPC = 1,
ILL_ILLOPN,
ILL_ILLADR,
ILL_ILLTRP,
ILL_PRVOPC,
ILL_PRVREG,
ILL_COPROC,
ILL_BADSTK
};
enum
{
FPE_INTDIV = 1,
FPE_INTOVF,
FPE_FLTDIV,
FPE_FLTOVF,
FPE_FLTUND,
FPE_FLTRES,
FPE_FLTINV,
FPE_FLTSUB
};
enum
{
SEGV_MAPERR = 1,
SEGV_ACCERR,
SEGV_BNDERR,
SEGV_PKUERR
};
enum
{
BUS_ADRALN = 1,
BUS_ADRERR,
BUS_OBJERR,
BUS_MCEERR_AR,
BUS_MCEERR_AO
};
# 151 "/usr/include/x86_64-linux-gnu/bits/siginfo-consts.h" 3 4
enum
{
CLD_EXITED = 1,
CLD_KILLED,
CLD_DUMPED,
CLD_TRAPPED,
CLD_STOPPED,
CLD_CONTINUED
};
enum
{
POLL_IN = 1,
POLL_OUT,
POLL_MSG,
POLL_ERR,
POLL_PRI,
POLL_HUP
};
# 59 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 1 3 4
# 16 "/usr/include/x86_64-linux-gnu/bits/types/sigval_t.h" 3 4
typedef __sigval_t sigval_t;
# 63 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/wordsize.h" 1 3 4
# 5 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 2 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/types/sigevent_t.h" 3 4
typedef struct sigevent
{
__sigval_t sigev_value;
int sigev_signo;
int sigev_notify;
union
{
int _pad[((64 / sizeof (int)) - 4)];
__pid_t _tid;
struct
{
void (*_function) (__sigval_t);
pthread_attr_t *_attribute;
} _sigev_thread;
} _sigev_un;
} sigevent_t;
# 67 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/sigevent-consts.h" 3 4
enum
{
SIGEV_SIGNAL = 0,
SIGEV_NONE,
SIGEV_THREAD,
SIGEV_THREAD_ID = 4
};
# 68 "/usr/include/signal.h" 2 3 4
typedef void (*__sighandler_t) (int);
extern __sighandler_t __sysv_signal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
# 88 "/usr/include/signal.h" 3 4
extern __sighandler_t signal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
# 112 "/usr/include/signal.h" 3 4
extern int kill (__pid_t __pid, int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int killpg (__pid_t __pgrp, int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern int raise (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern __sighandler_t ssignal (int __sig, __sighandler_t __handler)
__attribute__ ((__nothrow__ , __leaf__));
extern int gsignal (int __sig) __attribute__ ((__nothrow__ , __leaf__));
extern void psignal (int __sig, const char *__s);
extern void psiginfo (const siginfo_t *__pinfo, const char *__s);
# 170 "/usr/include/signal.h" 3 4
extern int sigblock (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
extern int sigsetmask (int __mask) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
extern int siggetmask (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 190 "/usr/include/signal.h" 3 4
typedef __sighandler_t sig_t;
extern int sigemptyset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigfillset (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigaddset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigdelset (sigset_t *__set, int __signo) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigismember (const sigset_t *__set, int __signo)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 226 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/sigaction.h" 3 4
struct sigaction
{
union
{
__sighandler_t sa_handler;
void (*sa_sigaction) (int, siginfo_t *, void *);
}
__sigaction_handler;
__sigset_t sa_mask;
int sa_flags;
void (*sa_restorer) (void);
};
# 227 "/usr/include/signal.h" 2 3 4
extern int sigprocmask (int __how, const sigset_t *__restrict __set,
sigset_t *__restrict __oset) __attribute__ ((__nothrow__ , __leaf__));
extern int sigsuspend (const sigset_t *__set) __attribute__ ((__nonnull__ (1)));
extern int sigaction (int __sig, const struct sigaction *__restrict __act,
struct sigaction *__restrict __oact) __attribute__ ((__nothrow__ , __leaf__));
extern int sigpending (sigset_t *__set) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int sigwait (const sigset_t *__restrict __set, int *__restrict __sig)
__attribute__ ((__nonnull__ (1, 2)));
extern int sigwaitinfo (const sigset_t *__restrict __set,
siginfo_t *__restrict __info) __attribute__ ((__nonnull__ (1)));
extern int sigtimedwait (const sigset_t *__restrict __set,
siginfo_t *__restrict __info,
const struct timespec *__restrict __timeout)
__attribute__ ((__nonnull__ (1)));
extern int sigqueue (__pid_t __pid, int __sig, const union sigval __val)
__attribute__ ((__nothrow__ , __leaf__));
# 286 "/usr/include/signal.h" 3 4
extern const char *const _sys_siglist[(64 + 1)];
extern const char *const sys_siglist[(64 + 1)];
# 1 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpx_sw_bytes
{
__uint32_t magic1;
__uint32_t extended_size;
__uint64_t xstate_bv;
__uint32_t xstate_size;
__uint32_t __glibc_reserved1[7];
};
struct _fpreg
{
unsigned short significand[4];
unsigned short exponent;
};
struct _fpxreg
{
unsigned short significand[4];
unsigned short exponent;
unsigned short __glibc_reserved1[3];
};
struct _xmmreg
{
__uint32_t element[4];
};
# 123 "/usr/include/x86_64-linux-gnu/bits/sigcontext.h" 3 4
struct _fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _fpxreg _st[8];
struct _xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
struct sigcontext
{
__uint64_t r8;
__uint64_t r9;
__uint64_t r10;
__uint64_t r11;
__uint64_t r12;
__uint64_t r13;
__uint64_t r14;
__uint64_t r15;
__uint64_t rdi;
__uint64_t rsi;
__uint64_t rbp;
__uint64_t rbx;
__uint64_t rdx;
__uint64_t rax;
__uint64_t rcx;
__uint64_t rsp;
__uint64_t rip;
__uint64_t eflags;
unsigned short cs;
unsigned short gs;
unsigned short fs;
unsigned short __pad0;
__uint64_t err;
__uint64_t trapno;
__uint64_t oldmask;
__uint64_t cr2;
__extension__ union
{
struct _fpstate * fpstate;
__uint64_t __fpstate_word;
};
__uint64_t __reserved1 [8];
};
struct _xsave_hdr
{
__uint64_t xstate_bv;
__uint64_t __glibc_reserved1[2];
__uint64_t __glibc_reserved2[5];
};
struct _ymmh_state
{
__uint32_t ymmh_space[64];
};
struct _xstate
{
struct _fpstate fpstate;
struct _xsave_hdr xstate_hdr;
struct _ymmh_state ymmh;
};
# 292 "/usr/include/signal.h" 2 3 4
extern int sigreturn (struct sigcontext *__scp) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 302 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/stack_t.h" 2 3 4
typedef struct
{
void *ss_sp;
int ss_flags;
size_t ss_size;
} stack_t;
# 304 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 1 3 4
# 37 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
__extension__ typedef long long int greg_t;
# 46 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
typedef greg_t gregset_t[23];
# 101 "/usr/include/x86_64-linux-gnu/sys/ucontext.h" 3 4
struct _libc_fpxreg
{
unsigned short int significand[4];
unsigned short int exponent;
unsigned short int __glibc_reserved1[3];
};
struct _libc_xmmreg
{
__uint32_t element[4];
};
struct _libc_fpstate
{
__uint16_t cwd;
__uint16_t swd;
__uint16_t ftw;
__uint16_t fop;
__uint64_t rip;
__uint64_t rdp;
__uint32_t mxcsr;
__uint32_t mxcr_mask;
struct _libc_fpxreg _st[8];
struct _libc_xmmreg _xmm[16];
__uint32_t __glibc_reserved1[24];
};
typedef struct _libc_fpstate *fpregset_t;
typedef struct
{
gregset_t gregs;
fpregset_t fpregs;
__extension__ unsigned long long __reserved1 [8];
} mcontext_t;
typedef struct ucontext_t
{
unsigned long int uc_flags;
struct ucontext_t *uc_link;
stack_t uc_stack;
mcontext_t uc_mcontext;
sigset_t uc_sigmask;
struct _libc_fpstate __fpregs_mem;
} ucontext_t;
# 307 "/usr/include/signal.h" 2 3 4
extern int siginterrupt (int __sig, int __interrupt) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/x86_64-linux-gnu/bits/sigstack.h" 1 3 4
# 317 "/usr/include/signal.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/ss_flags.h" 3 4
enum
{
SS_ONSTACK = 1,
SS_DISABLE
};
# 318 "/usr/include/signal.h" 2 3 4
extern int sigaltstack (const stack_t *__restrict __ss,
stack_t *__restrict __oss) __attribute__ ((__nothrow__ , __leaf__));
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_sigstack.h" 3 4
struct sigstack
{
void *ss_sp;
int ss_onstack;
};
# 328 "/usr/include/signal.h" 2 3 4
extern int sigstack (struct sigstack *__ss, struct sigstack *__oss)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__deprecated__));
# 359 "/usr/include/signal.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/sigthread.h" 3 4
extern int pthread_sigmask (int __how,
const __sigset_t *__restrict __newmask,
__sigset_t *__restrict __oldmask)__attribute__ ((__nothrow__ , __leaf__));
extern int pthread_kill (pthread_t __threadid, int __signo) __attribute__ ((__nothrow__ , __leaf__));
# 360 "/usr/include/signal.h" 2 3 4
extern int __libc_current_sigrtmin (void) __attribute__ ((__nothrow__ , __leaf__));
extern int __libc_current_sigrtmax (void) __attribute__ ((__nothrow__ , __leaf__));
# 35 "afl-fuzz-single.c" 2
# 1 "/usr/include/dirent.h" 1 3 4
# 27 "/usr/include/dirent.h" 3 4
# 61 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 1 3 4
# 22 "/usr/include/x86_64-linux-gnu/bits/dirent.h" 3 4
struct dirent
{
__ino_t d_ino;
__off_t d_off;
unsigned short int d_reclen;
unsigned char d_type;
char d_name[256];
};
# 62 "/usr/include/dirent.h" 2 3 4
# 97 "/usr/include/dirent.h" 3 4
enum
{
DT_UNKNOWN = 0,
DT_FIFO = 1,
DT_CHR = 2,
DT_DIR = 4,
DT_BLK = 6,
DT_REG = 8,
DT_LNK = 10,
DT_SOCK = 12,
DT_WHT = 14
};
# 127 "/usr/include/dirent.h" 3 4
typedef struct __dirstream DIR;
extern DIR *opendir (const char *__name) __attribute__ ((__nonnull__ (1)));
extern DIR *fdopendir (int __fd);
extern int closedir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 162 "/usr/include/dirent.h" 3 4
extern struct dirent *readdir (DIR *__dirp) __attribute__ ((__nonnull__ (1)));
# 183 "/usr/include/dirent.h" 3 4
extern int readdir_r (DIR *__restrict __dirp,
struct dirent *__restrict __entry,
struct dirent **__restrict __result)
__attribute__ ((__nonnull__ (1, 2, 3))) __attribute__ ((__deprecated__));
# 209 "/usr/include/dirent.h" 3 4
extern void rewinddir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern void seekdir (DIR *__dirp, long int __pos) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern long int telldir (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int dirfd (DIR *__dirp) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
# 233 "/usr/include/dirent.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 1 3 4
# 160 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 3 4
# 1 "/usr/include/linux/limits.h" 1 3 4
# 39 "/usr/include/x86_64-linux-gnu/bits/local_lim.h" 2 3 4
# 161 "/usr/include/x86_64-linux-gnu/bits/posix1_lim.h" 2 3 4
# 234 "/usr/include/dirent.h" 2 3 4
# 245 "/usr/include/dirent.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 246 "/usr/include/dirent.h" 2 3 4
# 255 "/usr/include/dirent.h" 3 4
extern int scandir (const char *__restrict __dir,
struct dirent ***__restrict __namelist,
int (*__selector) (const struct dirent *),
int (*__cmp) (const struct dirent **,
const struct dirent **))
__attribute__ ((__nonnull__ (1, 2)));
# 325 "/usr/include/dirent.h" 3 4
extern int alphasort (const struct dirent **__e1,
const struct dirent **__e2)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__pure__)) __attribute__ ((__nonnull__ (1, 2)));
# 353 "/usr/include/dirent.h" 3 4
extern __ssize_t getdirentries (int __fd, char *__restrict __buf,
size_t __nbytes,
__off_t *__restrict __basep)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
# 402 "/usr/include/dirent.h" 3 4
# 36 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/fcntl.h" 1 3 4
# 1 "/usr/include/fcntl.h" 1 3 4
# 28 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 1 3 4
# 35 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
struct flock
{
short int l_type;
short int l_whence;
__off_t l_start;
__off_t l_len;
__pid_t l_pid;
};
# 61 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 1 3 4
# 380 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 454 "/usr/include/x86_64-linux-gnu/bits/fcntl-linux.h" 3 4
# 61 "/usr/include/x86_64-linux-gnu/bits/fcntl.h" 2 3 4
# 36 "/usr/include/fcntl.h" 2 3 4
# 78 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 46 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
struct stat
{
__dev_t st_dev;
__ino_t st_ino;
__nlink_t st_nlink;
__mode_t st_mode;
__uid_t st_uid;
__gid_t st_gid;
int __pad0;
__dev_t st_rdev;
__off_t st_size;
__blksize_t st_blksize;
__blkcnt_t st_blocks;
# 91 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
struct timespec st_atim;
struct timespec st_mtim;
struct timespec st_ctim;
# 106 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
__syscall_slong_t __glibc_reserved[3];
# 115 "/usr/include/x86_64-linux-gnu/bits/stat.h" 3 4
};
# 79 "/usr/include/fcntl.h" 2 3 4
# 147 "/usr/include/fcntl.h" 3 4
extern int fcntl (int __fd, int __cmd, ...);
# 157 "/usr/include/fcntl.h" 3 4
extern int open (const char *__file, int __oflag, ...) __attribute__ ((__nonnull__ (1)));
# 181 "/usr/include/fcntl.h" 3 4
extern int openat (int __fd, const char *__file, int __oflag, ...)
__attribute__ ((__nonnull__ (2)));
# 203 "/usr/include/fcntl.h" 3 4
extern int creat (const char *__file, mode_t __mode) __attribute__ ((__nonnull__ (1)));
# 249 "/usr/include/fcntl.h" 3 4
extern int posix_fadvise (int __fd, off_t __offset, off_t __len,
int __advise) __attribute__ ((__nothrow__ , __leaf__));
# 271 "/usr/include/fcntl.h" 3 4
extern int posix_fallocate (int __fd, off_t __offset, off_t __len);
# 293 "/usr/include/fcntl.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/fcntl.h" 2 3 4
# 38 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/wait.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
# 77 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t wait (int *__stat_loc);
# 100 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern __pid_t waitpid (__pid_t __pid, int *__stat_loc, int __options);
# 121 "/usr/include/x86_64-linux-gnu/sys/wait.h" 3 4
extern int waitid (idtype_t __idtype, __id_t __id, siginfo_t *__infop,
int __options);
struct rusage;
extern __pid_t wait3 (int *__stat_loc, int __options,
struct rusage * __usage) __attribute__ ((__nothrow__));
extern __pid_t wait4 (__pid_t __pid, int *__stat_loc, int __options,
struct rusage *__usage) __attribute__ ((__nothrow__));
# 39 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/time.h" 1 3 4
# 34 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
# 52 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
struct timezone
{
int tz_minuteswest;
int tz_dsttime;
};
typedef struct timezone *__restrict __timezone_ptr_t;
# 68 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
extern int gettimeofday (struct timeval *__restrict __tv,
__timezone_ptr_t __tz) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int settimeofday (const struct timeval *__tv,
const struct timezone *__tz)
__attribute__ ((__nothrow__ , __leaf__));
extern int adjtime (const struct timeval *__delta,
struct timeval *__olddelta) __attribute__ ((__nothrow__ , __leaf__));
enum __itimer_which
{
ITIMER_REAL = 0,
ITIMER_VIRTUAL = 1,
ITIMER_PROF = 2
};
struct itimerval
{
struct timeval it_interval;
struct timeval it_value;
};
typedef int __itimer_which_t;
extern int getitimer (__itimer_which_t __which,
struct itimerval *__value) __attribute__ ((__nothrow__ , __leaf__));
extern int setitimer (__itimer_which_t __which,
const struct itimerval *__restrict __new,
struct itimerval *__restrict __old) __attribute__ ((__nothrow__ , __leaf__));
extern int utimes (const char *__file, const struct timeval __tvp[2])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int lutimes (const char *__file, const struct timeval __tvp[2])
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int futimes (int __fd, const struct timeval __tvp[2]) __attribute__ ((__nothrow__ , __leaf__));
# 186 "/usr/include/x86_64-linux-gnu/sys/time.h" 3 4
# 40 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/shm.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/shm.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/shm.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/ipc.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/ipc.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ipctypes.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/ipctypes.h" 3 4
typedef int __ipc_pid_t;
# 25 "/usr/include/x86_64-linux-gnu/sys/ipc.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/ipc.h" 1 3 4
# 42 "/usr/include/x86_64-linux-gnu/bits/ipc.h" 3 4
struct ipc_perm
{
__key_t __key;
__uid_t uid;
__gid_t gid;
__uid_t cuid;
__gid_t cgid;
unsigned short int mode;
unsigned short int __pad1;
unsigned short int __seq;
unsigned short int __pad2;
__syscall_ulong_t __glibc_reserved1;
__syscall_ulong_t __glibc_reserved2;
};
# 26 "/usr/include/x86_64-linux-gnu/sys/ipc.h" 2 3 4
# 47 "/usr/include/x86_64-linux-gnu/sys/ipc.h" 3 4
extern key_t ftok (const char *__pathname, int __proj_id) __attribute__ ((__nothrow__ , __leaf__));
# 28 "/usr/include/x86_64-linux-gnu/sys/shm.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/shm.h" 1 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/shm.h" 3 4
extern int __getpagesize (void) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
typedef __syscall_ulong_t shmatt_t;
struct shmid_ds
{
struct ipc_perm shm_perm;
size_t shm_segsz;
__time_t shm_atime;
__time_t shm_dtime;
__time_t shm_ctime;
__pid_t shm_cpid;
__pid_t shm_lpid;
shmatt_t shm_nattch;
__syscall_ulong_t __glibc_reserved4;
__syscall_ulong_t __glibc_reserved5;
};
# 84 "/usr/include/x86_64-linux-gnu/bits/shm.h" 3 4
struct shminfo
{
__syscall_ulong_t shmmax;
__syscall_ulong_t shmmin;
__syscall_ulong_t shmmni;
__syscall_ulong_t shmseg;
__syscall_ulong_t shmall;
__syscall_ulong_t __glibc_reserved1;
__syscall_ulong_t __glibc_reserved2;
__syscall_ulong_t __glibc_reserved3;
__syscall_ulong_t __glibc_reserved4;
};
struct shm_info
{
int used_ids;
__syscall_ulong_t shm_tot;
__syscall_ulong_t shm_rss;
__syscall_ulong_t shm_swp;
__syscall_ulong_t swap_attempts;
__syscall_ulong_t swap_successes;
};
# 31 "/usr/include/x86_64-linux-gnu/sys/shm.h" 2 3 4
# 43 "/usr/include/x86_64-linux-gnu/sys/shm.h" 3 4
extern int shmctl (int __shmid, int __cmd, struct shmid_ds *__buf) __attribute__ ((__nothrow__ , __leaf__));
extern int shmget (key_t __key, size_t __size, int __shmflg) __attribute__ ((__nothrow__ , __leaf__));
extern void *shmat (int __shmid, const void *__shmaddr, int __shmflg)
__attribute__ ((__nothrow__ , __leaf__));
extern int shmdt (const void *__shmaddr) __attribute__ ((__nothrow__ , __leaf__));
# 41 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/stat.h" 1 3 4
# 99 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/stat.h" 1 3 4
# 102 "/usr/include/x86_64-linux-gnu/sys/stat.h" 2 3 4
# 205 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int stat (const char *__restrict __file,
struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
extern int fstat (int __fd, struct stat *__buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
# 234 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int fstatat (int __fd, const char *__restrict __file,
struct stat *__restrict __buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
# 259 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int lstat (const char *__restrict __file,
struct stat *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1, 2)));
# 280 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int chmod (const char *__file, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int lchmod (const char *__file, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int fchmod (int __fd, __mode_t __mode) __attribute__ ((__nothrow__ , __leaf__));
extern int fchmodat (int __fd, const char *__file, __mode_t __mode,
int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2))) ;
extern __mode_t umask (__mode_t __mask) __attribute__ ((__nothrow__ , __leaf__));
# 317 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int mkdir (const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkdirat (int __fd, const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int mknod (const char *__path, __mode_t __mode, __dev_t __dev)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mknodat (int __fd, const char *__path, __mode_t __mode,
__dev_t __dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int mkfifo (const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (1)));
extern int mkfifoat (int __fd, const char *__path, __mode_t __mode)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int utimensat (int __fd, const char *__path,
const struct timespec __times[2],
int __flags)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2)));
extern int futimens (int __fd, const struct timespec __times[2]) __attribute__ ((__nothrow__ , __leaf__));
# 395 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int __fxstat (int __ver, int __fildes, struct stat *__stat_buf)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3)));
extern int __xstat (int __ver, const char *__filename,
struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __lxstat (int __ver, const char *__filename,
struct stat *__stat_buf) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 3)));
extern int __fxstatat (int __ver, int __fildes, const char *__filename,
struct stat *__stat_buf, int __flag)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 4)));
# 438 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
extern int __xmknod (int __ver, const char *__path, __mode_t __mode,
__dev_t *__dev) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (2, 4)));
extern int __xmknodat (int __ver, int __fd, const char *__path,
__mode_t __mode, __dev_t *__dev)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__nonnull__ (3, 5)));
# 530 "/usr/include/x86_64-linux-gnu/sys/stat.h" 3 4
# 42 "afl-fuzz-single.c" 2
# 1 "/usr/include/arpa/inet.h" 1 3 4
# 22 "/usr/include/arpa/inet.h" 3 4
# 1 "/usr/include/netinet/in.h" 1 3 4
# 23 "/usr/include/netinet/in.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/sys/socket.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 1 3 4
# 23 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/types/struct_iovec.h" 2 3 4
struct iovec
{
void *iov_base;
size_t iov_len;
};
# 27 "/usr/include/x86_64-linux-gnu/sys/socket.h" 2 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 29 "/usr/include/x86_64-linux-gnu/sys/socket.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/socket.h" 1 3 4
# 27 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
# 1 "/usr/lib/gcc/x86_64-linux-gnu/7/include/stddef.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/socket.h" 2 3 4
# 38 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/socket_type.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/bits/socket_type.h" 3 4
enum __socket_type
{
SOCK_STREAM = 1,
SOCK_DGRAM = 2,
SOCK_RAW = 3,
SOCK_RDM = 4,
SOCK_SEQPACKET = 5,
SOCK_DCCP = 6,
SOCK_PACKET = 10,
SOCK_CLOEXEC = 02000000,
SOCK_NONBLOCK = 00004000
};
# 39 "/usr/include/x86_64-linux-gnu/bits/socket.h" 2 3 4
# 172 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/sockaddr.h" 1 3 4
# 28 "/usr/include/x86_64-linux-gnu/bits/sockaddr.h" 3 4
typedef unsigned short int sa_family_t;
# 173 "/usr/include/x86_64-linux-gnu/bits/socket.h" 2 3 4
struct sockaddr
{
sa_family_t sa_family;
char sa_data[14];
};
# 188 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
struct sockaddr_storage
{
sa_family_t ss_family;
char __ss_padding[(128 - (sizeof (unsigned short int)) - sizeof (unsigned long int))];
unsigned long int __ss_align;
};
enum
{
MSG_OOB = 0x01,
MSG_PEEK = 0x02,
MSG_DONTROUTE = 0x04,
MSG_CTRUNC = 0x08,
MSG_PROXY = 0x10,
MSG_TRUNC = 0x20,
MSG_DONTWAIT = 0x40,
MSG_EOR = 0x80,
MSG_WAITALL = 0x100,
MSG_FIN = 0x200,
MSG_SYN = 0x400,
MSG_CONFIRM = 0x800,
MSG_RST = 0x1000,
MSG_ERRQUEUE = 0x2000,
MSG_NOSIGNAL = 0x4000,
MSG_MORE = 0x8000,
MSG_WAITFORONE = 0x10000,
MSG_BATCH = 0x40000,
MSG_ZEROCOPY = 0x4000000,
MSG_FASTOPEN = 0x20000000,
MSG_CMSG_CLOEXEC = 0x40000000
};
struct msghdr
{
void *msg_name;
socklen_t msg_namelen;
struct iovec *msg_iov;
size_t msg_iovlen;
void *msg_control;
size_t msg_controllen;
int msg_flags;
};
struct cmsghdr
{
size_t cmsg_len;
int cmsg_level;
int cmsg_type;
__extension__ unsigned char __cmsg_data [];
};
# 302 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
extern struct cmsghdr *__cmsg_nxthdr (struct msghdr *__mhdr,
struct cmsghdr *__cmsg) __attribute__ ((__nothrow__ , __leaf__));
# 329 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
enum
{
SCM_RIGHTS = 0x01
};
# 390 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/socket.h" 1 3 4
# 1 "/usr/include/asm-generic/socket.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/sockios.h" 1 3 4
# 1 "/usr/include/asm-generic/sockios.h" 1 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/sockios.h" 2 3 4
# 6 "/usr/include/asm-generic/socket.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/asm/socket.h" 2 3 4
# 391 "/usr/include/x86_64-linux-gnu/bits/socket.h" 2 3 4
# 444 "/usr/include/x86_64-linux-gnu/bits/socket.h" 3 4
struct linger
{
int l_onoff;
int l_linger;
};
# 34 "/usr/include/x86_64-linux-gnu/sys/socket.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_osockaddr.h" 1 3 4
struct osockaddr
{
unsigned short int sa_family;
unsigned char sa_data[14];
};
# 37 "/usr/include/x86_64-linux-gnu/sys/socket.h" 2 3 4
enum
{
SHUT_RD = 0,
SHUT_WR,
SHUT_RDWR
};
# 102 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern int socket (int __domain, int __type, int __protocol) __attribute__ ((__nothrow__ , __leaf__));
extern int socketpair (int __domain, int __type, int __protocol,
int __fds[2]) __attribute__ ((__nothrow__ , __leaf__));
extern int bind (int __fd, const struct sockaddr * __addr, socklen_t __len)
__attribute__ ((__nothrow__ , __leaf__));
extern int getsockname (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__));
# 126 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern int connect (int __fd, const struct sockaddr * __addr, socklen_t __len);
extern int getpeername (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __len) __attribute__ ((__nothrow__ , __leaf__));
extern ssize_t send (int __fd, const void *__buf, size_t __n, int __flags);
extern ssize_t recv (int __fd, void *__buf, size_t __n, int __flags);
extern ssize_t sendto (int __fd, const void *__buf, size_t __n,
int __flags, const struct sockaddr * __addr,
socklen_t __addr_len);
# 163 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern ssize_t recvfrom (int __fd, void *__restrict __buf, size_t __n,
int __flags, struct sockaddr *__restrict __addr,
socklen_t *__restrict __addr_len);
extern ssize_t sendmsg (int __fd, const struct msghdr *__message,
int __flags);
# 191 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern ssize_t recvmsg (int __fd, struct msghdr *__message, int __flags);
# 208 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern int getsockopt (int __fd, int __level, int __optname,
void *__restrict __optval,
socklen_t *__restrict __optlen) __attribute__ ((__nothrow__ , __leaf__));
extern int setsockopt (int __fd, int __level, int __optname,
const void *__optval, socklen_t __optlen) __attribute__ ((__nothrow__ , __leaf__));
extern int listen (int __fd, int __n) __attribute__ ((__nothrow__ , __leaf__));
# 232 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern int accept (int __fd, struct sockaddr *__restrict __addr,
socklen_t *__restrict __addr_len);
# 250 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
extern int shutdown (int __fd, int __how) __attribute__ ((__nothrow__ , __leaf__));
extern int sockatmark (int __fd) __attribute__ ((__nothrow__ , __leaf__));
extern int isfdtype (int __fd, int __fdtype) __attribute__ ((__nothrow__ , __leaf__));
# 272 "/usr/include/x86_64-linux-gnu/sys/socket.h" 3 4
# 24 "/usr/include/netinet/in.h" 2 3 4
typedef uint32_t in_addr_t;
struct in_addr
{
in_addr_t s_addr;
};
# 1 "/usr/include/x86_64-linux-gnu/bits/in.h" 1 3 4
# 142 "/usr/include/x86_64-linux-gnu/bits/in.h" 3 4
struct ip_opts
{
struct in_addr ip_dst;
char ip_opts[40];
};
struct ip_mreqn
{
struct in_addr imr_multiaddr;
struct in_addr imr_address;
int imr_ifindex;
};
struct in_pktinfo
{
int ipi_ifindex;
struct in_addr ipi_spec_dst;
struct in_addr ipi_addr;
};
# 38 "/usr/include/netinet/in.h" 2 3 4
enum
{
IPPROTO_IP = 0,
IPPROTO_ICMP = 1,
IPPROTO_IGMP = 2,
IPPROTO_IPIP = 4,
IPPROTO_TCP = 6,
IPPROTO_EGP = 8,
IPPROTO_PUP = 12,
IPPROTO_UDP = 17,
IPPROTO_IDP = 22,
IPPROTO_TP = 29,
IPPROTO_DCCP = 33,
IPPROTO_IPV6 = 41,
IPPROTO_RSVP = 46,
IPPROTO_GRE = 47,
IPPROTO_ESP = 50,
IPPROTO_AH = 51,
IPPROTO_MTP = 92,
IPPROTO_BEETPH = 94,
IPPROTO_ENCAP = 98,
IPPROTO_PIM = 103,
IPPROTO_COMP = 108,
IPPROTO_SCTP = 132,
IPPROTO_UDPLITE = 136,
IPPROTO_MPLS = 137,
IPPROTO_RAW = 255,
IPPROTO_MAX
};
enum
{
IPPROTO_HOPOPTS = 0,
IPPROTO_ROUTING = 43,
IPPROTO_FRAGMENT = 44,
IPPROTO_ICMPV6 = 58,
IPPROTO_NONE = 59,
IPPROTO_DSTOPTS = 60,
IPPROTO_MH = 135
};
typedef uint16_t in_port_t;
enum
{
IPPORT_ECHO = 7,
IPPORT_DISCARD = 9,
IPPORT_SYSTAT = 11,
IPPORT_DAYTIME = 13,
IPPORT_NETSTAT = 15,
IPPORT_FTP = 21,
IPPORT_TELNET = 23,
IPPORT_SMTP = 25,
IPPORT_TIMESERVER = 37,
IPPORT_NAMESERVER = 42,
IPPORT_WHOIS = 43,
IPPORT_MTP = 57,
IPPORT_TFTP = 69,
IPPORT_RJE = 77,
IPPORT_FINGER = 79,
IPPORT_TTYLINK = 87,
IPPORT_SUPDUP = 95,
IPPORT_EXECSERVER = 512,
IPPORT_LOGINSERVER = 513,
IPPORT_CMDSERVER = 514,
IPPORT_EFSSERVER = 520,
IPPORT_BIFFUDP = 512,
IPPORT_WHOSERVER = 513,
IPPORT_ROUTESERVER = 520,
IPPORT_RESERVED = 1024,
IPPORT_USERRESERVED = 5000
};
# 211 "/usr/include/netinet/in.h" 3 4
struct in6_addr
{
union
{
uint8_t __u6_addr8[16];
uint16_t __u6_addr16[8];
uint32_t __u6_addr32[4];
} __in6_u;
};
extern const struct in6_addr in6addr_any;
extern const struct in6_addr in6addr_loopback;
# 237 "/usr/include/netinet/in.h" 3 4
struct sockaddr_in
{
sa_family_t sin_family;
in_port_t sin_port;
struct in_addr sin_addr;
unsigned char sin_zero[sizeof (struct sockaddr) -
(sizeof (unsigned short int)) -
sizeof (in_port_t) -
sizeof (struct in_addr)];
};
struct sockaddr_in6
{
sa_family_t sin6_family;
in_port_t sin6_port;
uint32_t sin6_flowinfo;
struct in6_addr sin6_addr;
uint32_t sin6_scope_id;
};
struct ip_mreq
{
struct in_addr imr_multiaddr;
struct in_addr imr_interface;
};
struct ip_mreq_source
{
struct in_addr imr_multiaddr;
struct in_addr imr_interface;
struct in_addr imr_sourceaddr;
};
struct ipv6_mreq
{
struct in6_addr ipv6mr_multiaddr;
unsigned int ipv6mr_interface;
};
struct group_req
{
uint32_t gr_interface;
struct sockaddr_storage gr_group;
};
struct group_source_req
{
uint32_t gsr_interface;
struct sockaddr_storage gsr_group;
struct sockaddr_storage gsr_source;
};
struct ip_msfilter
{
struct in_addr imsf_multiaddr;
struct in_addr imsf_interface;
uint32_t imsf_fmode;
uint32_t imsf_numsrc;
struct in_addr imsf_slist[1];
};
struct group_filter
{
uint32_t gf_interface;
struct sockaddr_storage gf_group;
uint32_t gf_fmode;
uint32_t gf_numsrc;
struct sockaddr_storage gf_slist[1];
};
# 374 "/usr/include/netinet/in.h" 3 4
extern uint32_t ntohl (uint32_t __netlong) __attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern uint16_t ntohs (uint16_t __netshort)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern uint32_t htonl (uint32_t __hostlong)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
extern uint16_t htons (uint16_t __hostshort)
__attribute__ ((__nothrow__ , __leaf__)) __attribute__ ((__const__));
# 1 "/usr/include/x86_64-linux-gnu/bits/byteswap.h" 1 3 4
# 386 "/usr/include/netinet/in.h" 2 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/uintn-identity.h" 1 3 4
# 387 "/usr/include/netinet/in.h" 2 3 4
# 502 "/usr/include/netinet/in.h" 3 4
extern int bindresvport (int __sockfd, struct sockaddr_in *__sock_in) __attribute__ ((__nothrow__ , __leaf__));
extern int bindresvport6 (int __sockfd, struct sockaddr_in6 *__sock_in)
__attribute__ ((__nothrow__ , __leaf__));
# 630 "/usr/include/netinet/in.h" 3 4
# 23 "/usr/include/arpa/inet.h" 2 3 4
extern in_addr_t inet_addr (const char *__cp) __attribute__ ((__nothrow__ , __leaf__));
extern in_addr_t inet_lnaof (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__));
extern struct in_addr inet_makeaddr (in_addr_t __net, in_addr_t __host)
__attribute__ ((__nothrow__ , __leaf__));
extern in_addr_t inet_netof (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__));
extern in_addr_t inet_network (const char *__cp) __attribute__ ((__nothrow__ , __leaf__));
extern char *inet_ntoa (struct in_addr __in) __attribute__ ((__nothrow__ , __leaf__));
extern int inet_pton (int __af, const char *__restrict __cp,
void *__restrict __buf) __attribute__ ((__nothrow__ , __leaf__));
extern const char *inet_ntop (int __af, const void *__restrict __cp,
char *__restrict __buf, socklen_t __len)
__attribute__ ((__nothrow__ , __leaf__));
extern int inet_aton (const char *__cp, struct in_addr *__inp) __attribute__ ((__nothrow__ , __leaf__));
extern char *inet_neta (in_addr_t __net, char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern char *inet_net_ntop (int __af, const void *__cp, int __bits,
char *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern int inet_net_pton (int __af, const char *__cp,
void *__buf, size_t __len) __attribute__ ((__nothrow__ , __leaf__));
extern unsigned int inet_nsap_addr (const char *__cp,
unsigned char *__buf, int __len) __attribute__ ((__nothrow__ , __leaf__));
extern char *inet_nsap_ntoa (int __len, const unsigned char *__cp,
char *__buf) __attribute__ ((__nothrow__ , __leaf__));
# 44 "afl-fuzz-single.c" 2
# 1 "/usr/include/x86_64-linux-gnu/sys/resource.h" 1 3 4
# 24 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
# 1 "/usr/include/x86_64-linux-gnu/bits/resource.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
enum __rlimit_resource
{
RLIMIT_CPU = 0,
RLIMIT_FSIZE = 1,
RLIMIT_DATA = 2,
RLIMIT_STACK = 3,
RLIMIT_CORE = 4,
__RLIMIT_RSS = 5,
RLIMIT_NOFILE = 7,
__RLIMIT_OFILE = RLIMIT_NOFILE,
RLIMIT_AS = 9,
__RLIMIT_NPROC = 6,
__RLIMIT_MEMLOCK = 8,
__RLIMIT_LOCKS = 10,
__RLIMIT_SIGPENDING = 11,
__RLIMIT_MSGQUEUE = 12,
__RLIMIT_NICE = 13,
__RLIMIT_RTPRIO = 14,
__RLIMIT_RTTIME = 15,
__RLIMIT_NLIMITS = 16,
__RLIM_NLIMITS = __RLIMIT_NLIMITS
};
# 131 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
typedef __rlim_t rlim_t;
struct rlimit
{
rlim_t rlim_cur;
rlim_t rlim_max;
};
# 158 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
enum __rusage_who
{
RUSAGE_SELF = 0,
RUSAGE_CHILDREN = -1
# 176 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
};
# 1 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 1 3 4
# 31 "/usr/include/x86_64-linux-gnu/bits/types/struct_rusage.h" 3 4
struct rusage
{
struct timeval ru_utime;
struct timeval ru_stime;
__extension__ union
{
long int ru_maxrss;
__syscall_slong_t __ru_maxrss_word;
};
__extension__ union
{
long int ru_ixrss;
__syscall_slong_t __ru_ixrss_word;
};
__extension__ union
{
long int ru_idrss;
__syscall_slong_t __ru_idrss_word;
};
__extension__ union
{
long int ru_isrss;
__syscall_slong_t __ru_isrss_word;
};
__extension__ union
{
long int ru_minflt;
__syscall_slong_t __ru_minflt_word;
};
__extension__ union
{
long int ru_majflt;
__syscall_slong_t __ru_majflt_word;
};
__extension__ union
{
long int ru_nswap;
__syscall_slong_t __ru_nswap_word;
};
__extension__ union
{
long int ru_inblock;
__syscall_slong_t __ru_inblock_word;
};
__extension__ union
{
long int ru_oublock;
__syscall_slong_t __ru_oublock_word;
};
__extension__ union
{
long int ru_msgsnd;
__syscall_slong_t __ru_msgsnd_word;
};
__extension__ union
{
long int ru_msgrcv;
__syscall_slong_t __ru_msgrcv_word;
};
__extension__ union
{
long int ru_nsignals;
__syscall_slong_t __ru_nsignals_word;
};
__extension__ union
{
long int ru_nvcsw;
__syscall_slong_t __ru_nvcsw_word;
};
__extension__ union
{
long int ru_nivcsw;
__syscall_slong_t __ru_nivcsw_word;
};
};
# 180 "/usr/include/x86_64-linux-gnu/bits/resource.h" 2 3 4
enum __priority_which
{
PRIO_PROCESS = 0,
PRIO_PGRP = 1,
PRIO_USER = 2
};
# 223 "/usr/include/x86_64-linux-gnu/bits/resource.h" 3 4
# 25 "/usr/include/x86_64-linux-gnu/sys/resource.h" 2 3 4
# 42 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
typedef int __rlimit_resource_t;
typedef int __rusage_who_t;
typedef int __priority_which_t;
extern int getrlimit (__rlimit_resource_t __resource,
struct rlimit *__rlimits) __attribute__ ((__nothrow__ , __leaf__));
# 69 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
extern int setrlimit (__rlimit_resource_t __resource,
const struct rlimit *__rlimits) __attribute__ ((__nothrow__ , __leaf__));
# 87 "/usr/include/x86_64-linux-gnu/sys/resource.h" 3 4
extern int getrusage (__rusage_who_t __who, struct rusage *__usage) __attribute__ ((__nothrow__ , __leaf__));
extern int getpriority (__priority_which_t __which, id_t __who) __attribute__ ((__nothrow__ , __leaf__));
extern int setpriority (__priority_which_t __which, id_t __who, int __prio)
__attribute__ ((__nothrow__ , __leaf__));
# 45 "afl-fuzz-single.c" 2
# 47 "afl-fuzz-single.c"
static u8 *in_dir,
*out_file,
*out_dir;
static u32 exec_tmout = 4000,
mem_limit = 100;
static u8 keep_testcases,
skip_deterministic,
dumb_mode,
kill_signal;
static s32 out_fd,
dev_null;
static s32 child_pid;
static u8* trace_bits;
static u8 virgin_bits[65536];
static s32 shm_id;
static volatile u8 stop_soon,
clear_screen,
child_timed_out;
static u64 unique_queued,
unique_processed,
total_crashes,
total_hangs,
queued_later,
abandoned_inputs,
total_execs,
start_time,
queue_cycle;
static u32 queue_len;
static u32 subseq_hangs;
static u8* stage_name;
static s32 stage_cur, stage_max;
static u64 stage_finds[10],
stage_cycles[10];
struct queue_entry {
u8* fname;
u32 len;
u8 keep;
u8 det_done;
struct queue_entry* next;
};
static struct queue_entry *queue,
*queue_cur,
*queue_top;
static u8 interesting_8[] = { -128, -1, 0, 1, 16, 32, 64, 100, 127 };
static u16 interesting_16[] = { -128, -1, 0, 1, 16, 32, 64, 100, 127, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767 };
static u32 interesting_32[] = { -128, -1, 0, 1, 16, 32, 64, 100, 127, -32768, -129, 128, 255, 256, 512, 1000, 1024, 4096, 32767, -2147483648LL, -100000000, -32769, 32768, 65535, 65536, 100000000, 2147483647 };
static void add_to_queue(u8* fname, u32 len, u8 keep) {
struct queue_entry* q = DFL_ck_alloc(sizeof(struct queue_entry));
q->fname = fname;
q->len = len;
q->keep = keep;
if (queue_top) {
queue_top->next = q;
queue_top = q;
} else queue = queue_top = q;
queue_len++;
unique_queued++;
if (queue_cycle > 1) queued_later++;
}
static void destroy_queue(void) {
struct queue_entry *q = queue, *n;
while (q) {
n = q->next;
if (!q->keep && !keep_testcases)
unlink(q->fname);
DFL_ck_free(q->fname);
DFL_ck_free(q);
q = n;
}
}
static inline u8 has_new_bits(void) {
u32* current = (u32*)trace_bits;
u32* virgin = (u32*)virgin_bits;
u32 i = (65536 >> 2);
u8 ret = 0;
while (i--) {
if (*current & *virgin) {
*virgin &= ~*current;
ret = 1;
}
current++;
virgin++;
}
return ret;
}
static inline u32 count_bits(u8* mem) {
u32* ptr = (u32*)mem;
u32 i = (65536 >> 2);
u32 ret = 0;
while (i--) {
u32 v = *(ptr++);
v -= ((v >> 1) & 0x55555555);
v = (v & 0x33333333) + ((v >> 2) & 0x33333333);
ret += (((v + (v >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
}
return ret;
}
static void remove_shm(void) {
shmctl(shm_id,
# 214 "afl-fuzz-single.c" 3 4
0
# 214 "afl-fuzz-single.c"
,
# 214 "afl-fuzz-single.c" 3 4
((void *)0)
# 214 "afl-fuzz-single.c"
);
}
static void setup_shm(void) {
u8* shm_str;
memset(virgin_bits, 255, 65536);
shm_id = shmget(
# 226 "afl-fuzz-single.c" 3 4
((__key_t) 0)
# 226 "afl-fuzz-single.c"
, 65536,
# 226 "afl-fuzz-single.c" 3 4
01000
# 226 "afl-fuzz-single.c"
|
# 226 "afl-fuzz-single.c" 3 4
02000
# 226 "afl-fuzz-single.c"
| 0600);
if (shm_id < 0) do { fprintf(
# 228 "afl-fuzz-single.c" 3 4
stderr
# 228 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "shmget() failed"); fprintf(
# 228 "afl-fuzz-single.c" 3 4
stderr
# 228 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 228); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 228 "afl-fuzz-single.c" 3 4
stderr
# 228 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
atexit(remove_shm);
shm_str = ({ u8* _tmp; s32 _len = snprintf(
# 232 "afl-fuzz-single.c" 3 4
((void *)0)
# 232 "afl-fuzz-single.c"
, 0, "%d", shm_id); if (_len < 0) do { fprintf(
# 232 "afl-fuzz-single.c" 3 4
stderr
# 232 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 232 "afl-fuzz-single.c" 3 4
stderr
# 232 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 232); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%d", shm_id); _tmp; });
setenv("__AFL_SHM_ID", shm_str, 1);
DFL_ck_free(shm_str);
trace_bits = shmat(shm_id,
# 238 "afl-fuzz-single.c" 3 4
((void *)0)
# 238 "afl-fuzz-single.c"
, 0);
if (!trace_bits) do { fprintf(
# 240 "afl-fuzz-single.c" 3 4
stderr
# 240 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "shmat() failed"); fprintf(
# 240 "afl-fuzz-single.c" 3 4
stderr
# 240 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 240); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 240 "afl-fuzz-single.c" 3 4
stderr
# 240 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
}
static void read_testcases(void) {
DIR* d = opendir(in_dir);
struct dirent* de;
if (!d) do { fprintf(
# 252 "afl-fuzz-single.c" 3 4
stderr
# 252 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to open '%s'", in_dir); fprintf(
# 252 "afl-fuzz-single.c" 3 4
stderr
# 252 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 252); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 252 "afl-fuzz-single.c" 3 4
stderr
# 252 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
while ((de = readdir(d))) {
struct stat st;
u8* fn = ({ u8* _tmp; s32 _len = snprintf(
# 257 "afl-fuzz-single.c" 3 4
((void *)0)
# 257 "afl-fuzz-single.c"
, 0, "%s/%s", in_dir, de->d_name); if (_len < 0) do { fprintf(
# 257 "afl-fuzz-single.c" 3 4
stderr
# 257 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 257 "afl-fuzz-single.c" 3 4
stderr
# 257 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 257); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/%s", in_dir, de->d_name); _tmp; });
if (stat(fn, &st) || access(fn,
# 259 "afl-fuzz-single.c" 3 4
4
# 259 "afl-fuzz-single.c"
))
do { fprintf(
# 260 "afl-fuzz-single.c" 3 4
stderr
# 260 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to access '%s'", fn); fprintf(
# 260 "afl-fuzz-single.c" 3 4
stderr
# 260 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 260); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 260 "afl-fuzz-single.c" 3 4
stderr
# 260 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
if (!
# 262 "afl-fuzz-single.c" 3 4
((((
# 262 "afl-fuzz-single.c"
st.st_mode
# 262 "afl-fuzz-single.c" 3 4
)) & 0170000) == (0100000))
# 262 "afl-fuzz-single.c"
|| !st.st_size) {
DFL_ck_free(fn);
continue;
}
if (st.st_size > (1 * 1000 * 1000))
do { fprintf(
# 270 "afl-fuzz-single.c" 3 4
stderr
# 270 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Test case '%s' is too big", fn); fprintf(
# 270 "afl-fuzz-single.c" 3 4
stderr
# 270 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 270); exit(1); } while (0);
add_to_queue(fn, st.st_size, 1);
}
if (!unique_queued) do { fprintf(
# 276 "afl-fuzz-single.c" 3 4
stderr
# 276 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "No usable test cases in '%s'", in_dir); fprintf(
# 276 "afl-fuzz-single.c" 3 4
stderr
# 276 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 276); exit(1); } while (0);
}
# 289 "afl-fuzz-single.c"
static u8 run_target(char** argv) {
static struct itimerval it;
int status;
child_timed_out = 0;
memset(trace_bits, 0, 65536);
child_pid = fork();
if (child_pid < 0) do { fprintf(
# 300 "afl-fuzz-single.c" 3 4
stderr
# 300 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "fork() failed"); fprintf(
# 300 "afl-fuzz-single.c" 3 4
stderr
# 300 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 300); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 300 "afl-fuzz-single.c" 3 4
stderr
# 300 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
if (!child_pid) {
struct rlimit r;
r.rlim_max = r.rlim_cur = ((rlim_t)mem_limit) << 20;
setrlimit(
# 308 "afl-fuzz-single.c" 3 4
RLIMIT_AS
# 308 "afl-fuzz-single.c"
, &r);
setsid();
dup2(dev_null, 1);
dup2(dev_null, 2);
if (out_file) {
dup2(dev_null, 0);
} else {
dup2(out_fd, 0);
close(out_fd);
}
close(dev_null);
execvp(argv[0], argv);
exit(0x55);
}
it.it_value.tv_sec = (exec_tmout / 1000);
it.it_value.tv_usec = (exec_tmout % 1000) * 1000;
setitimer(
# 345 "afl-fuzz-single.c" 3 4
ITIMER_REAL
# 345 "afl-fuzz-single.c"
, &it,
# 345 "afl-fuzz-single.c" 3 4
((void *)0)
# 345 "afl-fuzz-single.c"
);
if (waitpid(child_pid, &status,
# 347 "afl-fuzz-single.c" 3 4
2
# 347 "afl-fuzz-single.c"
) <= 0) do { fprintf(
# 347 "afl-fuzz-single.c" 3 4
stderr
# 347 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "waitpid() failed"); fprintf(
# 347 "afl-fuzz-single.c" 3 4
stderr
# 347 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 347); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 347 "afl-fuzz-single.c" 3 4
stderr
# 347 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
child_pid = 0;
it.it_value.tv_sec = 0;
it.it_value.tv_usec = 0;
setitimer(
# 353 "afl-fuzz-single.c" 3 4
ITIMER_REAL
# 353 "afl-fuzz-single.c"
, &it,
# 353 "afl-fuzz-single.c" 3 4
((void *)0)
# 353 "afl-fuzz-single.c"
);
total_execs++;
if (child_timed_out) return 1;
if (
# 361 "afl-fuzz-single.c" 3 4
(((signed char) (((
# 361 "afl-fuzz-single.c"
status
# 361 "afl-fuzz-single.c" 3 4
) & 0x7f) + 1) >> 1) > 0)
# 361 "afl-fuzz-single.c"
&& !stop_soon) {
kill_signal =
# 362 "afl-fuzz-single.c" 3 4
((
# 362 "afl-fuzz-single.c"
status
# 362 "afl-fuzz-single.c" 3 4
) & 0x7f)
# 362 "afl-fuzz-single.c"
;
return 2;
}
if (
# 366 "afl-fuzz-single.c" 3 4
(((
# 366 "afl-fuzz-single.c"
status
# 366 "afl-fuzz-single.c" 3 4
) & 0xff00) >> 8)
# 366 "afl-fuzz-single.c"
== 0x55) return 3;
return 0;
}
static void perform_dry_run(char** argv) {
struct queue_entry* q = queue;
while (q) {
u8 fault;
u32 i;
do { fprintf(
# 385 "afl-fuzz-single.c" 3 4
stderr
# 385 "afl-fuzz-single.c"
, "\x1b[1;34m" "[*] " "\x1b[0;37m" "Verifying test case '%s'...", q->fname); fprintf(
# 385 "afl-fuzz-single.c" 3 4
stderr
# 385 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); } while (0);
if (!out_file) {
out_fd = open(q->fname,
# 389 "afl-fuzz-single.c" 3 4
00
# 389 "afl-fuzz-single.c"
);
if (out_fd < 0) do { fprintf(
# 390 "afl-fuzz-single.c" 3 4
stderr
# 390 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to open '%s'", q->fname); fprintf(
# 390 "afl-fuzz-single.c" 3 4
stderr
# 390 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 390); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 390 "afl-fuzz-single.c" 3 4
stderr
# 390 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
} else {
unlink(out_file);
if (link(q->fname, out_file)) do { fprintf(
# 395 "afl-fuzz-single.c" 3 4
stderr
# 395 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "link() failed"); fprintf(
# 395 "afl-fuzz-single.c" 3 4
stderr
# 395 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 395); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 395 "afl-fuzz-single.c" 3 4
stderr
# 395 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
}
fault = run_target(argv);
if (stop_soon) return;
switch (fault) {
case 1: do { fprintf(
# 404 "afl-fuzz-single.c" 3 4
stderr
# 404 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Test case '%s' results in a hang (adjusting -t " "may help)", q->fname); fprintf(
# 404 "afl-fuzz-single.c" 3 4
stderr
# 404 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 405); exit(1); } while (0)
;
case 2: do { fprintf(
# 407 "afl-fuzz-single.c" 3 4
stderr
# 407 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Test case '%s' results in a crash", q->fname); fprintf(
# 407 "afl-fuzz-single.c" 3 4
stderr
# 407 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 407); exit(1); } while (0);
case 3: do { fprintf(
# 409 "afl-fuzz-single.c" 3 4
stderr
# 409 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Unable to execute target application ('%s')", argv[0]); fprintf(
# 409 "afl-fuzz-single.c" 3 4
stderr
# 409 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 410); exit(1); } while (0)
;
}
if (!has_new_bits() && !dumb_mode)
do { fprintf(
# 415 "afl-fuzz-single.c" 3 4
stderr
# 415 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "No instrumentation detected (you can always try -n)"); fprintf(
# 415 "afl-fuzz-single.c" 3 4
stderr
# 415 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 415); exit(1); } while (0);
for (i = 0; (i < 15) && !stop_soon; i++) usleep(100000);
if (stop_soon) return;
for (i = 0; i < 4; i++) {
if (!out_file) lseek(out_fd, 0,
# 424 "afl-fuzz-single.c" 3 4
0
# 424 "afl-fuzz-single.c"
);
fault = run_target(argv);
if (stop_soon) return;
switch (fault) {
case 1: do { fprintf(
# 431 "afl-fuzz-single.c" 3 4
stderr
# 431 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Test case '%s' results in intermittent hangs " "(adjusting -t may help)", q->fname); fprintf(
# 431 "afl-fuzz-single.c" 3 4
stderr
# 431 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 432); exit(1); } while (0)
;
case 2: do { fprintf(
# 434 "afl-fuzz-single.c" 3 4
stderr
# 434 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Test case '%s' results in intermittent " "crashes", q->fname); fprintf(
# 434 "afl-fuzz-single.c" 3 4
stderr
# 434 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 435); exit(1); } while (0)
;
case 3: do { fprintf(
# 437 "afl-fuzz-single.c" 3 4
stderr
# 437 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Unable to execute target application (huh)"); fprintf(
# 437 "afl-fuzz-single.c" 3 4
stderr
# 437 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 437); exit(1); } while (0);
}
if (has_new_bits())
do { fprintf(
# 442 "afl-fuzz-single.c" 3 4
stderr
# 442 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Inconsistent instrumentation output for test case '%s'", q->fname); fprintf(
# 442 "afl-fuzz-single.c" 3 4
stderr
# 442 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 443); exit(1); } while (0)
;
}
if (!out_file) close(out_fd);
do { fprintf(
# 449 "afl-fuzz-single.c" 3 4
stderr
# 449 "afl-fuzz-single.c"
, "\x1b[1;32m" "[+] " "\x1b[0;37m" "Done: %u bits set, %u remaining in the bitmap.\n", count_bits(trace_bits), count_bits(virgin_bits)); fprintf(
# 449 "afl-fuzz-single.c" 3 4
stderr
# 449 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); } while (0)
;
q = q->next;
}
}
static void write_to_testcase(void* mem, u32 len) {
s32 fd = out_fd;
if (out_file) {
unlink(out_file);
fd = open(out_file,
# 475 "afl-fuzz-single.c" 3 4
01
# 475 "afl-fuzz-single.c"
|
# 475 "afl-fuzz-single.c" 3 4
0100
# 475 "afl-fuzz-single.c"
|
# 475 "afl-fuzz-single.c" 3 4
0200
# 475 "afl-fuzz-single.c"
, 0600);
if (fd < 0) do { fprintf(
# 477 "afl-fuzz-single.c" 3 4
stderr
# 477 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s'", out_file); fprintf(
# 477 "afl-fuzz-single.c" 3 4
stderr
# 477 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 477); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 477 "afl-fuzz-single.c" 3 4
stderr
# 477 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
} else lseek(fd, 0,
# 479 "afl-fuzz-single.c" 3 4
0
# 479 "afl-fuzz-single.c"
);
if (write(fd, mem, len) != len)
do { fprintf(
# 482 "afl-fuzz-single.c" 3 4
stderr
# 482 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Short write to output file"); fprintf(
# 482 "afl-fuzz-single.c" 3 4
stderr
# 482 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 482); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 482 "afl-fuzz-single.c" 3 4
stderr
# 482 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
if (!out_file) {
if (ftruncate(fd, len)) do { fprintf(
# 486 "afl-fuzz-single.c" 3 4
stderr
# 486 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "ftruncate() failed"); fprintf(
# 486 "afl-fuzz-single.c" 3 4
stderr
# 486 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 486); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 486 "afl-fuzz-single.c" 3 4
stderr
# 486 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
lseek(fd, 0,
# 487 "afl-fuzz-single.c" 3 4
0
# 487 "afl-fuzz-single.c"
);
} else close(fd);
}
static void save_if_interesting(void* mem, u32 len, u8 fault) {
u8* fn = "";
s32 fd;
switch (fault) {
case 0:
if (!has_new_bits()) return;
fn = ({ u8* _tmp; s32 _len = snprintf(
# 507 "afl-fuzz-single.c" 3 4
((void *)0)
# 507 "afl-fuzz-single.c"
, 0, "%s/queue/%llu", out_dir, unique_queued); if (_len < 0) do { fprintf(
# 507 "afl-fuzz-single.c" 3 4
stderr
# 507 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 507 "afl-fuzz-single.c" 3 4
stderr
# 507 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 507); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/queue/%llu", out_dir, unique_queued); _tmp; });
add_to_queue(fn, len, 0);
break;
case 1:
fn = ({ u8* _tmp; s32 _len = snprintf(
# 512 "afl-fuzz-single.c" 3 4
((void *)0)
# 512 "afl-fuzz-single.c"
, 0, "%s/hangs/%llu", out_dir, total_hangs); if (_len < 0) do { fprintf(
# 512 "afl-fuzz-single.c" 3 4
stderr
# 512 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 512 "afl-fuzz-single.c" 3 4
stderr
# 512 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 512); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/hangs/%llu", out_dir, total_hangs); _tmp; });
total_hangs++;
break;
case 2:
fn = ({ u8* _tmp; s32 _len = snprintf(
# 517 "afl-fuzz-single.c" 3 4
((void *)0)
# 517 "afl-fuzz-single.c"
, 0, "%s/crashes/%llu-signal%u", out_dir, total_crashes, kill_signal); if (_len < 0) do { fprintf(
# 517 "afl-fuzz-single.c" 3 4
stderr
# 517 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 517 "afl-fuzz-single.c" 3 4
stderr
# 517 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 518); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/crashes/%llu-signal%u", out_dir, total_crashes, kill_signal); _tmp; })
;
total_crashes++;
break;
case 3: do { fprintf(
# 522 "afl-fuzz-single.c" 3 4
stderr
# 522 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Unable to execute target application"); fprintf(
# 522 "afl-fuzz-single.c" 3 4
stderr
# 522 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 522); exit(1); } while (0);
}
fd = open(fn,
# 526 "afl-fuzz-single.c" 3 4
01
# 526 "afl-fuzz-single.c"
|
# 526 "afl-fuzz-single.c" 3 4
0100
# 526 "afl-fuzz-single.c"
|
# 526 "afl-fuzz-single.c" 3 4
0200
# 526 "afl-fuzz-single.c"
|
# 526 "afl-fuzz-single.c" 3 4
0400000
# 526 "afl-fuzz-single.c"
, 0600);
if (fd < 0) do { fprintf(
# 528 "afl-fuzz-single.c" 3 4
stderr
# 528 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s'\n", fn); fprintf(
# 528 "afl-fuzz-single.c" 3 4
stderr
# 528 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 528); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 528 "afl-fuzz-single.c" 3 4
stderr
# 528 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
if (write(fd, mem, len) != len) do { fprintf(
# 530 "afl-fuzz-single.c" 3 4
stderr
# 530 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Short write to '%s'", fn); fprintf(
# 530 "afl-fuzz-single.c" 3 4
stderr
# 530 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 530); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 530 "afl-fuzz-single.c" 3 4
stderr
# 530 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
if (fault) DFL_ck_free(fn);
close(fd);
}
static void show_stats(void) {
struct timeval tv;
struct timezone tz;
s64 run_time;
u32 run_d, run_h, run_m;
double run_s;
u32 vbits = (65536 << 3) - count_bits(virgin_bits);
gettimeofday(&tv, &tz);
run_time = (tv.tv_sec * 1000L) + (tv.tv_usec / 1000) - start_time;
if (!run_time) run_time = 1;
run_d = run_time / 1000 / 60 / 60 / 24;
run_h = (run_time / 1000 / 60 / 60) % 24;
run_m = (run_time / 1000 / 60) % 60;
run_s = ((double)(run_time % 60000)) / 1000;
printf("\x1b[H" "\x1b[0;36m" "afl-fuzz " "\x1b[1;37m" """\x1b[1;33m" "\n--------------\n\n" "\x1b[0;36m" "Queue cycle: " "\x1b[1;37m" "%llu\n\n" "\x1b[1;30m" " Overall run time : " "\x1b[0;37m" "%u day%s, %u hr%s, %u min, %0.02f sec" " \n", queue_cycle, run_d, (run_d == 1) ? "" : "s", run_h, (run_h == 1) ? "" : "s", run_m, run_s)
# 572 "afl-fuzz-single.c"
;
printf("\x1b[1;30m" " Execution paths : " "\x1b[0;37m" "%llu+%llu/%llu done " "(%0.02f%%) \n", unique_processed, abandoned_inputs, unique_queued, ((double)unique_processed + abandoned_inputs) * 100 / unique_queued)
;
printf("\x1b[1;30m" " Current stage : " "\x1b[0;37m" "%s, %u/%u done (%0.02f%%) \n", stage_name, stage_cur, stage_max, ((double)stage_cur) * 100 / stage_max)
;
printf("\x1b[1;30m" " Execution cycles : " "\x1b[0;37m" "%llu (%0.02f per second) \n", total_execs, ((double)total_execs) * 1000 / run_time)
;
printf("\x1b[1;30m" " Problems found : " "\x1b[0;37m" "%llu crashes, %llu hangs \n", total_crashes, total_hangs)
;
printf("\x1b[1;30m" " Bitmap density : " "\x1b[0;37m" "%u tuples seen (%0.02f%%) \n", vbits, ((double)vbits) * 100 / (65536 << 3))
;
printf("\x1b[1;30m" " Fuzzing efficiency : " "\x1b[0;37m" "paths = %0.02f ppm, faults = %0.02f ppm" "\x1b[0m" " \n\n", ((double)unique_queued) * 1000000 / total_execs, ((double)total_crashes + total_hangs) * 1000000 / total_execs)
;
printf("\x1b[0;36m" "Per-stage yields:\n\n" "\x1b[1;30m" " Bit-level flips : " "\x1b[0;37m" "%llu/%llu, %llu/%llu, %llu/%llu\n", stage_finds[0], stage_cycles[0], stage_finds[1], stage_cycles[1], stage_finds[2], stage_cycles[2])
;
printf("\x1b[1;30m" " Byte-level flips : " "\x1b[0;37m" "%llu/%llu, %llu/%llu, %llu/%llu\n", stage_finds[3], stage_cycles[3], stage_finds[4], stage_cycles[4], stage_finds[5], stage_cycles[5])
;
printf("\x1b[1;30m" " Interesting ints : " "\x1b[0;37m" "%llu/%llu, %llu/%llu, %llu/%llu\n", stage_finds[6], stage_cycles[6], stage_finds[7], stage_cycles[7], stage_finds[8], stage_cycles[8])
;
printf("\x1b[1;30m" " Random tweaks : " "\x1b[0;37m" "%llu/%llu (%llu latent paths)" "\x1b[0m" "\n\n", stage_finds[9], stage_cycles[9], queued_later)
;
}
static u8 common_fuzz_stuff(char** argv, u8* out_buf, u32 len) {
u8 fault;
write_to_testcase(out_buf, len);
fault = run_target(argv);
if (stop_soon) return 1;
if (fault == 1 && subseq_hangs++ > 20) {
abandoned_inputs++;
return 1;
} else subseq_hangs = 0;
save_if_interesting(out_buf, len, fault);
if (!(stage_cur % 100) || stage_cur + 1 == stage_max) show_stats();
return 0;
}
static void fuzz_one(char** argv) {
s32 len, fd, temp_len;
u8 *in_buf, *out_buf;
s32 i, j;
u64 orig_hit_cnt, new_hit_cnt;
fd = open(queue_cur->fname,
# 665 "afl-fuzz-single.c" 3 4
00
# 665 "afl-fuzz-single.c"
);
if (fd < 0) do { fprintf(
# 667 "afl-fuzz-single.c" 3 4
stderr
# 667 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to open '%s'", queue_cur->fname); fprintf(
# 667 "afl-fuzz-single.c" 3 4
stderr
# 667 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 667); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 667 "afl-fuzz-single.c" 3 4
stderr
# 667 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
len = queue_cur->len;
in_buf = DFL_ck_alloc(len),
out_buf = DFL_ck_alloc(len);
if (read(fd, in_buf, len) != len)
do { fprintf(
# 675 "afl-fuzz-single.c" 3 4
stderr
# 675 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Short read from '%s'", queue_cur->fname); fprintf(
# 675 "afl-fuzz-single.c" 3 4
stderr
# 675 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 675); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 675 "afl-fuzz-single.c" 3 4
stderr
# 675 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
close(fd);
memcpy(out_buf, in_buf, len);
subseq_hangs = 0;
if (skip_deterministic || queue_cur->det_done) goto havoc_stage;
stage_name = "bitflip 1/1";
stage_max = len << 3;
orig_hit_cnt = unique_queued + total_hangs + total_crashes;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[0] += new_hit_cnt - orig_hit_cnt;
stage_cycles[0] += stage_max;
stage_name = "bitflip 2/1";
stage_max = (len << 3) - 1;
orig_hit_cnt = new_hit_cnt;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
do { out_buf[(stage_cur + 1) >> 3] ^= (1 << ((stage_cur + 1) & 7)); } while (0);
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
do { out_buf[(stage_cur + 1) >> 3] ^= (1 << ((stage_cur + 1) & 7)); } while (0);
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[1] += new_hit_cnt - orig_hit_cnt;
stage_cycles[1] += stage_max;
stage_name = "bitflip 4/1";
stage_max = (len << 3) - 3;
orig_hit_cnt = new_hit_cnt;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
do { out_buf[(stage_cur + 1) >> 3] ^= (1 << ((stage_cur + 1) & 7)); } while (0);
do { out_buf[(stage_cur + 2) >> 3] ^= (1 << ((stage_cur + 2) & 7)); } while (0);
do { out_buf[(stage_cur + 3) >> 3] ^= (1 << ((stage_cur + 3) & 7)); } while (0);
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
do { out_buf[(stage_cur) >> 3] ^= (1 << ((stage_cur) & 7)); } while (0);
do { out_buf[(stage_cur + 1) >> 3] ^= (1 << ((stage_cur + 1) & 7)); } while (0);
do { out_buf[(stage_cur + 2) >> 3] ^= (1 << ((stage_cur + 2) & 7)); } while (0);
do { out_buf[(stage_cur + 3) >> 3] ^= (1 << ((stage_cur + 3) & 7)); } while (0);
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[2] += new_hit_cnt - orig_hit_cnt;
stage_cycles[2] += stage_max;
stage_name = "bitflip 8/8";
stage_max = len;
orig_hit_cnt = new_hit_cnt;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
out_buf[stage_cur] ^= 0xFF;
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
out_buf[stage_cur] ^= 0xFF;
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[3] += new_hit_cnt - orig_hit_cnt;
stage_cycles[3] += stage_max;
stage_name = "bitflip 16/8";
stage_max = len - 1;
orig_hit_cnt = new_hit_cnt;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
*(u16*)(out_buf + stage_cur) ^= 0xFFFF;
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
*(u16*)(out_buf + stage_cur) ^= 0xFFFF;
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[4] += new_hit_cnt - orig_hit_cnt;
stage_cycles[4] += stage_max;
stage_name = "bitflip 32/8";
stage_max = len - 3;
orig_hit_cnt = new_hit_cnt;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
*(u32*)(out_buf + stage_cur) ^= 0xFFFFFFFF;
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
*(u32*)(out_buf + stage_cur) ^= 0xFFFFFFFF;
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[5] += new_hit_cnt - orig_hit_cnt;
stage_cycles[5] += stage_max;
stage_name = "interest 8/8";
stage_cur = 0;
stage_max = len * sizeof(interesting_8);
orig_hit_cnt = new_hit_cnt;
for (i = 0; i < len; i++) {
u8 orig = out_buf[i];
for (j = 0; j < sizeof(interesting_8); j++) {
out_buf[i] = interesting_8[j];
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
out_buf[i] = orig;
stage_cur++;
}
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[6] += new_hit_cnt - orig_hit_cnt;
stage_cycles[6] += stage_max;
stage_name = "interest 16/8";
stage_cur = 0;
stage_max = len * sizeof(interesting_16);
orig_hit_cnt = new_hit_cnt;
for (i = 0; i < len - 1; i++) {
u16 orig = *(u16*)(out_buf+i);
for (j = 0; j < sizeof(interesting_16) / 2; j++) {
*(u16*)(out_buf + i) = interesting_16[j];
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
stage_cur++;
if ((((interesting_16[j]) << 8) | ((interesting_16[j]) >> 8)) != interesting_16[j]) {
*(u16*)(out_buf + i) = (((interesting_16[j]) << 8) | ((interesting_16[j]) >> 8));
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
stage_cur++;
} else stage_max--;
*(u16*)(out_buf + i) = orig;
}
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[7] += new_hit_cnt - orig_hit_cnt;
stage_cycles[7] += stage_max;
stage_name = "interest 32/8";
stage_cur = 0;
stage_max = len * sizeof(interesting_32) / 2;
orig_hit_cnt = new_hit_cnt;
for (i = 0; i < len - 3; i++) {
u32 orig = *(u32*)(out_buf + i);
for (j = 0; j < sizeof(interesting_32) / 4; j++) {
*(u32*)(out_buf + i) = interesting_32[j];
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
stage_cur++;
if ((((interesting_32[j]) << 24) | ((interesting_32[j]) >> 24) | (((interesting_32[j]) << 8) & 0x00FF0000) | (((interesting_32[j]) >> 8) & 0x0000FF00)) != interesting_32[j]) {
*(u32*)(out_buf + i) = (((interesting_32[j]) << 24) | ((interesting_32[j]) >> 24) | (((interesting_32[j]) << 8) & 0x00FF0000) | (((interesting_32[j]) >> 8) & 0x0000FF00));
if (common_fuzz_stuff(argv, out_buf, len)) goto abandon_entry;
stage_cur++;
} else stage_max--;
*(u32*)(out_buf + i) = orig;
}
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[8] += new_hit_cnt - orig_hit_cnt;
stage_cycles[8] += stage_max;
havoc_stage:
queue_cur->det_done = 1;
stage_name = "havoc";
stage_max = 5000;
temp_len = len;
orig_hit_cnt = unique_queued + total_hangs + total_crashes;
for (stage_cur = 0; stage_cur < stage_max; stage_cur++) {
u32 use_stacking = (random() % (5)) + 1;
for (i = 0; i < use_stacking; i++) {
switch ((random() % (7))) {
case 0:
do { out_buf[((random() % (temp_len << 3))) >> 3] ^= (1 << (((random() % (temp_len << 3))) & 7)); } while (0);
break;
case 1:
out_buf[(random() % (temp_len))] = interesting_8[(random() % (sizeof(interesting_8)))];
break;
case 2:
if (temp_len < 2) break;
if ((random() % (2))) {
*(u16*)(out_buf + (random() % (temp_len - 1))) =
interesting_16[(random() % (sizeof(interesting_16) >> 1))];
} else {
*(u16*)(out_buf + (random() % (temp_len - 1))) = htons(
interesting_16[(random() % (sizeof(interesting_16) >> 1))]);
}
break;
case 3:
if (temp_len < 4) break;
if ((random() % (2))) {
*(u32*)(out_buf + (random() % (temp_len - 3))) =
interesting_32[(random() % (sizeof(interesting_32) >> 2))];
} else {
*(u32*)(out_buf + (random() % (temp_len - 3))) = htonl(
interesting_32[(random() % (sizeof(interesting_32) >> 2))]);
}
break;
case 4:
out_buf[(random() % (temp_len))] = (random() % (256));
break;
case 5: {
u32 del_from, del_len, max_chunk_len;
if (temp_len == 1) break;
max_chunk_len = (((temp_len - 1) * 75 / 100) > (100) ? (100) : ((temp_len - 1) * 75 / 100))
;
del_len = 1 + (random() % (max_chunk_len ? max_chunk_len : 1));
del_from = (random() % (temp_len - del_len + 1));
memmove(out_buf + del_from, out_buf + del_from + del_len,
temp_len - del_from - del_len);
temp_len -= del_len;
break;
}
case 6: {
u32 clone_from, clone_to, clone_len, max_chunk_len;
u8* new_buf;
max_chunk_len = ((temp_len * 75 / 100) > (100) ? (100) : (temp_len * 75 / 100))
;
clone_len = 1 + (random() % (max_chunk_len ? max_chunk_len : 1));
clone_from = (random() % (temp_len - clone_len + 1));
clone_to = (random() % (temp_len));
new_buf = DFL_ck_alloc(temp_len + clone_len);
memcpy(new_buf, out_buf, clone_to);
memcpy(new_buf + clone_to, out_buf + clone_from, clone_len);
memcpy(new_buf + clone_to + clone_len, out_buf + clone_to,
temp_len - clone_to);
DFL_ck_free(out_buf);
out_buf = new_buf;
temp_len += clone_len;
break;
}
}
}
if (common_fuzz_stuff(argv, out_buf, temp_len))
goto abandon_entry;
if (temp_len < len) out_buf = DFL_ck_realloc(out_buf, len);
temp_len = len;
memcpy(out_buf, in_buf, len);
}
new_hit_cnt = unique_queued + total_hangs + total_crashes;
stage_finds[9] += new_hit_cnt - orig_hit_cnt;
stage_cycles[9] += stage_max;
unique_processed++;
abandon_entry:
DFL_ck_free(in_buf);
DFL_ck_free(out_buf);
}
static void handle_stop_sig(int sig) {
stop_soon = 1;
if (child_pid > 0) kill(child_pid,
# 1097 "afl-fuzz-single.c" 3 4
9
# 1097 "afl-fuzz-single.c"
);
}
static void handle_timeout(int sig) {
child_timed_out = 1;
if (child_pid > 0) kill(child_pid,
# 1107 "afl-fuzz-single.c" 3 4
9
# 1107 "afl-fuzz-single.c"
);
}
static void setup_random(void) {
u32 seed;
struct timeval tv;
struct timezone tz;
gettimeofday(&tv, &tz);
seed = tv.tv_sec ^ tv.tv_usec ^ getpid();
srandom(seed);
start_time = (tv.tv_sec * 1000L) + (tv.tv_usec / 1000);
}
static void usage(u8* argv0) {
printf("\n%s [ options ] -- /path/to/traced_app [ ... ]\n\n" "Required parameters:\n\n" " -i dir - input directory with test cases\n" " -o dir - output directory for captured crashes\n\n" "Execution control settings:\n\n" " -f file - input filed used by the traced application\n" " -t msec - timeout for each run (%u ms)\n" " -m megs - memory limit for child process (%u MB)\n" "Fuzzing behavior settings:\n\n" " -d - skip all deterministic fuzzing stages\n" " -k - keep all discovered test cases\n" " -n - fuzz non-instrumented binaries (dumb mode)\n\n" "For additional tips, please consult the provided documentation.\n\n", argv0, 4000, 100)
# 1155 "afl-fuzz-single.c"
;
exit(1);
}
static void setup_dirs(void) {
u8* tmp;
if (mkdir(out_dir, 0700) &&
# 1168 "afl-fuzz-single.c" 3 4
(*__errno_location ())
# 1168 "afl-fuzz-single.c"
!=
# 1168 "afl-fuzz-single.c" 3 4
17
# 1168 "afl-fuzz-single.c"
)
do { fprintf(
# 1169 "afl-fuzz-single.c" 3 4
stderr
# 1169 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s'", out_dir); fprintf(
# 1169 "afl-fuzz-single.c" 3 4
stderr
# 1169 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1169); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1169 "afl-fuzz-single.c" 3 4
stderr
# 1169 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
tmp = ({ u8* _tmp; s32 _len = snprintf(
# 1171 "afl-fuzz-single.c" 3 4
((void *)0)
# 1171 "afl-fuzz-single.c"
, 0, "%s/queue", out_dir); if (_len < 0) do { fprintf(
# 1171 "afl-fuzz-single.c" 3 4
stderr
# 1171 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 1171 "afl-fuzz-single.c" 3 4
stderr
# 1171 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1171); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/queue", out_dir); _tmp; });
if (mkdir(tmp, 0700))
do { fprintf(
# 1174 "afl-fuzz-single.c" 3 4
stderr
# 1174 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s' (delete existing directories first)", tmp); fprintf(
# 1174 "afl-fuzz-single.c" 3 4
stderr
# 1174 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1174); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1174 "afl-fuzz-single.c" 3 4
stderr
# 1174 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
DFL_ck_free(tmp);
tmp = ({ u8* _tmp; s32 _len = snprintf(
# 1178 "afl-fuzz-single.c" 3 4
((void *)0)
# 1178 "afl-fuzz-single.c"
, 0, "%s/crashes", out_dir); if (_len < 0) do { fprintf(
# 1178 "afl-fuzz-single.c" 3 4
stderr
# 1178 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 1178 "afl-fuzz-single.c" 3 4
stderr
# 1178 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1178); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/crashes", out_dir); _tmp; });
if (mkdir(tmp, 0700))
do { fprintf(
# 1181 "afl-fuzz-single.c" 3 4
stderr
# 1181 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s' (delete existing directories first)", tmp); fprintf(
# 1181 "afl-fuzz-single.c" 3 4
stderr
# 1181 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1181); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1181 "afl-fuzz-single.c" 3 4
stderr
# 1181 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
DFL_ck_free(tmp);
tmp = ({ u8* _tmp; s32 _len = snprintf(
# 1185 "afl-fuzz-single.c" 3 4
((void *)0)
# 1185 "afl-fuzz-single.c"
, 0, "%s/hangs", out_dir); if (_len < 0) do { fprintf(
# 1185 "afl-fuzz-single.c" 3 4
stderr
# 1185 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 1185 "afl-fuzz-single.c" 3 4
stderr
# 1185 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1185); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/hangs", out_dir); _tmp; });
if (mkdir(tmp, 0700))
do { fprintf(
# 1188 "afl-fuzz-single.c" 3 4
stderr
# 1188 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s' (delete existing directories first)", tmp); fprintf(
# 1188 "afl-fuzz-single.c" 3 4
stderr
# 1188 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1188); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1188 "afl-fuzz-single.c" 3 4
stderr
# 1188 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
DFL_ck_free(tmp);
}
static void setup_stdio_file(void) {
u8* fn = ({ u8* _tmp; s32 _len = snprintf(
# 1199 "afl-fuzz-single.c" 3 4
((void *)0)
# 1199 "afl-fuzz-single.c"
, 0, "%s/.cur_input", out_dir); if (_len < 0) do { fprintf(
# 1199 "afl-fuzz-single.c" 3 4
stderr
# 1199 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Whoa, snprintf() fails?!"); fprintf(
# 1199 "afl-fuzz-single.c" 3 4
stderr
# 1199 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1199); exit(1); } while (0); _tmp = DFL_ck_alloc(_len + 1); snprintf((char*)_tmp, _len + 1, "%s/.cur_input", out_dir); _tmp; });
unlink(fn);
out_fd = open(fn,
# 1203 "afl-fuzz-single.c" 3 4
02
# 1203 "afl-fuzz-single.c"
|
# 1203 "afl-fuzz-single.c" 3 4
0100
# 1203 "afl-fuzz-single.c"
|
# 1203 "afl-fuzz-single.c" 3 4
0200
# 1203 "afl-fuzz-single.c"
|
# 1203 "afl-fuzz-single.c" 3 4
0400000
# 1203 "afl-fuzz-single.c"
, 0600);
if (out_fd < 0) do { fprintf(
# 1205 "afl-fuzz-single.c" 3 4
stderr
# 1205 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to create '%s'", fn); fprintf(
# 1205 "afl-fuzz-single.c" 3 4
stderr
# 1205 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1205); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1205 "afl-fuzz-single.c" 3 4
stderr
# 1205 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
DFL_ck_free(fn);
}
static void handle_resize(int sig) {
clear_screen = 1;
}
int main(int argc, char** argv) {
s32 opt;
printf("\x1b[0;36m" "afl-fuzz " "\x1b[1;37m" """\x1b[0;37m" " (" "Jul 2 2018" " " "09:10:07" ") by <lcamtuf@google.com>\n")
;
signal(
# 1229 "afl-fuzz-single.c" 3 4
1
# 1229 "afl-fuzz-single.c"
, handle_stop_sig);
signal(
# 1230 "afl-fuzz-single.c" 3 4
2
# 1230 "afl-fuzz-single.c"
, handle_stop_sig);
signal(
# 1231 "afl-fuzz-single.c" 3 4
15
# 1231 "afl-fuzz-single.c"
, handle_stop_sig);
signal(
# 1232 "afl-fuzz-single.c" 3 4
14
# 1232 "afl-fuzz-single.c"
, handle_timeout);
signal(
# 1233 "afl-fuzz-single.c" 3 4
28
# 1233 "afl-fuzz-single.c"
, handle_resize);
signal(
# 1235 "afl-fuzz-single.c" 3 4
20
# 1235 "afl-fuzz-single.c"
,
# 1235 "afl-fuzz-single.c" 3 4
((__sighandler_t) 1)
# 1235 "afl-fuzz-single.c"
);
signal(
# 1236 "afl-fuzz-single.c" 3 4
13
# 1236 "afl-fuzz-single.c"
,
# 1236 "afl-fuzz-single.c" 3 4
((__sighandler_t) 1)
# 1236 "afl-fuzz-single.c"
);
while ((opt = getopt(argc,argv,"+i:o:f:m:t:kdn")) > 0)
switch (opt) {
case 'i':
if (in_dir) do { fprintf(
# 1244 "afl-fuzz-single.c" 3 4
stderr
# 1244 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Multiple -i options not supported"); fprintf(
# 1244 "afl-fuzz-single.c" 3 4
stderr
# 1244 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1244); exit(1); } while (0);
in_dir = optarg;
break;
case 'o':
if (out_dir) do { fprintf(
# 1250 "afl-fuzz-single.c" 3 4
stderr
# 1250 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Multiple -o options not supported"); fprintf(
# 1250 "afl-fuzz-single.c" 3 4
stderr
# 1250 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1250); exit(1); } while (0);
out_dir = optarg;
break;
case 'f':
if (out_file) do { fprintf(
# 1256 "afl-fuzz-single.c" 3 4
stderr
# 1256 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Multiple -f options not supported"); fprintf(
# 1256 "afl-fuzz-single.c" 3 4
stderr
# 1256 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1256); exit(1); } while (0);
out_file = optarg;
break;
case 't':
exec_tmout = atoi(optarg);
if (exec_tmout < 20) do { fprintf(
# 1263 "afl-fuzz-single.c" 3 4
stderr
# 1263 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad or dangerously low value of -t"); fprintf(
# 1263 "afl-fuzz-single.c" 3 4
stderr
# 1263 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1263); exit(1); } while (0);
break;
case 'm':
mem_limit = atoi(optarg);
if (mem_limit < 10) do { fprintf(
# 1269 "afl-fuzz-single.c" 3 4
stderr
# 1269 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] PROGRAM ABORT : " "\x1b[1;37m" "Bad or dangerously low value of -m"); fprintf(
# 1269 "afl-fuzz-single.c" 3 4
stderr
# 1269 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Location : " "\x1b[0;37m" "%s(), %s:%u\n\n" "\x1b[0m", __FUNCTION__, "afl-fuzz-single.c", 1269); exit(1); } while (0);
break;
case 'k':
keep_testcases = 1;
break;
case 'd':
skip_deterministic = 1;
break;
case 'n':
dumb_mode = 1;
break;
default:
usage(argv[0]);
}
if (optind == argc || !in_dir || !out_dir) usage(argv[0]);
dev_null = open("/dev/null",
# 1295 "afl-fuzz-single.c" 3 4
02
# 1295 "afl-fuzz-single.c"
);
if (dev_null < 0) do { fprintf(
# 1296 "afl-fuzz-single.c" 3 4
stderr
# 1296 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n[-] SYSTEM ERROR : " "\x1b[1;37m" "Unable to open /dev/null"); fprintf(
# 1296 "afl-fuzz-single.c" 3 4
stderr
# 1296 "afl-fuzz-single.c"
, "\x1b[1;31m" "\n Stop location : " "\x1b[0;37m" "%s(), %s:%u\n", __FUNCTION__, "afl-fuzz-single.c", 1296); perror("\x1b[1;31m" " OS message " "\x1b[0;37m"); fprintf(
# 1296 "afl-fuzz-single.c" 3 4
stderr
# 1296 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); exit(1); } while (0);
setup_shm();
setup_dirs();
read_testcases();
perform_dry_run(argv + optind);
if (!stop_soon) {
setup_random();
if (!out_file) setup_stdio_file();
}
printf("\x1b[H" "\x1b[2J");
while (!stop_soon) {
if (!queue_cur) {
queue_cycle++;
unique_processed = 0;
abandoned_inputs = 0;
queue_cur = queue;
show_stats();
}
fuzz_one(argv + optind);
queue_cur = queue_cur->next;
if (clear_screen) {
printf("\x1b[H" "\x1b[2J");
show_stats();
clear_screen = 0;
}
}
show_stats();
if (stop_soon) printf("\x1b[1;31m" "\n+++ Testing aborted by user +++\n" "\x1b[0m");
destroy_queue();
;
do { fprintf(
# 1347 "afl-fuzz-single.c" 3 4
stderr
# 1347 "afl-fuzz-single.c"
, "\x1b[1;32m" "[+] " "\x1b[0;37m" "We're done here. Have a nice day!"); fprintf(
# 1347 "afl-fuzz-single.c" 3 4
stderr
# 1347 "afl-fuzz-single.c"
, "\x1b[0m" "\n"); } while (0);
exit(0);
}
Could you see what happens when you try to compile it?
It does seem to drop the function.
OK, the problem appears to be that when I upgraded the translator version on the website that I forgot to turn relooper support back on. I've fixed that mistake and also updated the c2rust.com website to document which extra flags I was using in the demonstration.
https://c2rust.com/#Environment
Could you see if this resolved your issue?
@glguy Yup, it helped and only leaves this:
error[E0277]: the trait bound `__dirstream: std::marker::Sized` is not satisfied
--> /tmp/a.rs:1037:10
|
1037 | if d.is_null() {
| ^^^^^^^ `__dirstream` does not have a constant size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `__dirstream`
error: aborting due to previous error
I don't seem to get that error locally. What version of rustc
are you using?
@glguy
[12:04:18] ➜ ~ % rustc /tmp/output.rs
error[E0277]: the trait bound `__dirstream: std::marker::Sized` is not satisfied
--> /tmp/output.rs:1037:10
|
1037 | if d.is_null() {
| ^^^^^^^ `__dirstream` does not have a constant size known at compile-time
|
= help: the trait `std::marker::Sized` is not implemented for `__dirstream`
error: aborting due to previous error
[12:04:41] ➜ ~ % rustc --version
rustc 1.23.0-nightly (fa26421f5 2017-11-15)
OK, you'll need to update your rust nightly version. We're using 2018-06-20
for testing now. Sometime between your version and the one we're using .is_null
became a const function. That will fix the problem!
In order to reproduce, copy-paste the following code into the website and observe the errors after trying to compile: