Exploit databaseDownload repository ZIP
GH-434e775a284528ea1560b46a7196307d
tgies/copy-fail-c
Sources for CVE-2026-31431
166 sourcesPreferred order: Exploit-DB, Metasploit, then GitHub repositories by stars. Open preferred source
Repository files46
tgies/copy-fail-cRevision 2361d859962f
- ↑..Parent directory
- sys/
- .gitignore
- Makefile
- arch-arm.h
- arch-arm64.h
- arch-loongarch.h
- arch-m68k.h
- arch-mips.h
- arch-powerpc.h
- arch-riscv.h
- arch-s390.h
- arch-sh.h
- arch-sparc.h
- arch-x86.h
- arch.h
- byteswap.h
- compiler.h
- crt.h
- ctype.h
- dirent.h
- elf.h
- endian.h
- err.h
- errno.h
- fcntl.h
- getopt.h
- inttypes.h
- limits.h
- math.h
- nolibc.h
- poll.h
- sched.h
- signal.h
- stackprotector.h
- std.h
- stdarg.h
- stdbool.h
- stddef.h
- stdint.h
- stdio.h
- stdlib.h
- string.h
- sys.h
- time.h
- types.h
- unistd.h
Files from this repository share one source choice. Supporting files may cover other vulnerabilities.
nolibc/crt.h
Text · 3,200 bytes/* SPDX-License-Identifier: LGPL-2.1 OR MIT */
/*
* C Run Time support for NOLIBC
* Copyright (C) 2023 Zhangjin Wu <[email protected]>
*/
#ifndef _NOLIBC_CRT_H
#define _NOLIBC_CRT_H
#ifndef NOLIBC_NO_RUNTIME
#include "compiler.h"
char **environ __attribute__((weak));
const unsigned long *_auxv __attribute__((weak));
void _start(void);
static void __stack_chk_init(void);
static void exit(int);
static char *strrchr(const char *s, int c);
extern void (*const __preinit_array_start[])(int, char **, char**) __attribute__((weak));
extern void (*const __preinit_array_end[])(int, char **, char**) __attribute__((weak));
extern void (*const __init_array_start[])(int, char **, char**) __attribute__((weak));
extern void (*const __init_array_end[])(int, char **, char**) __attribute__((weak));
extern void (*const __fini_array_start[])(void) __attribute__((weak));
extern void (*const __fini_array_end[])(void) __attribute__((weak));
#ifndef NOLIBC_IGNORE_ERRNO
extern char *program_invocation_name __attribute__((weak));
extern char *program_invocation_short_name __attribute__((weak));
static __inline__
char *__nolibc_program_invocation_short_name(char *long_name)
{
char *short_name;
short_name = strrchr(long_name, '/');
if (!short_name || !short_name[0])
return long_name;
return short_name + 1;
}
#endif /* NOLIBC_IGNORE_ERRNO */
void _start_c(long *sp);
__attribute__((weak,used)) __nolibc_no_sanitize_undefined
void _start_c(long *sp)
{
long argc;
char **argv;
char **envp;
int exitcode;
void (* const *ctor_func)(int, char **, char **);
void (* const *dtor_func)(void);
const unsigned long *auxv;
/* silence potential warning: conflicting types for 'main' */
int _nolibc_main(int, char **, char **) __asm__ ("main");
/* initialize stack protector */
__stack_chk_init();
/*
* sp : argc <-- argument count, required by main()
* argv: argv[0] <-- argument vector, required by main()
* argv[1]
* ...
* argv[argc-1]
* null
* environ: environ[0] <-- environment variables, required by main() and getenv()
* environ[1]
* ...
* null
* _auxv: _auxv[0] <-- auxiliary vector, required by getauxval()
* _auxv[1]
* ...
* null
*/
/* assign argc and argv */
argc = *sp;
argv = (void *)(sp + 1);
/* find environ */
environ = envp = argv + argc + 1;
/* find _auxv */
for (auxv = (void *)envp; *auxv++;)
;
_auxv = auxv;
#ifndef NOLIBC_IGNORE_ERRNO
if (argc > 0 && argv[0]) {
program_invocation_name = argv[0];
program_invocation_short_name = __nolibc_program_invocation_short_name(argv[0]);
}
#endif /* NOLIBC_IGNORE_ERRNO */
for (ctor_func = __preinit_array_start; ctor_func < __preinit_array_end; ctor_func++)
(*ctor_func)(argc, argv, envp);
for (ctor_func = __init_array_start; ctor_func < __init_array_end; ctor_func++)
(*ctor_func)(argc, argv, envp);
/* go to application */
exitcode = _nolibc_main(argc, argv, envp);
for (dtor_func = __fini_array_end; dtor_func > __fini_array_start;)
(*--dtor_func)();
exit(exitcode);
}
#endif /* NOLIBC_NO_RUNTIME */
#endif /* _NOLIBC_CRT_H */