mirror of
https://github.com/elicpeter/nyx.git
synced 2026-06-30 20:39:39 +02:00
Dynamic (#77)
This commit is contained in:
parent
55247b7fcd
commit
991c84a1eb
1464 changed files with 225448 additions and 1985 deletions
|
|
@ -0,0 +1,25 @@
|
|||
/* Benign control for the recursive C receiver fixture. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct ShellRunner {
|
||||
int enabled;
|
||||
} ShellRunner;
|
||||
|
||||
typedef struct CommandRunner {
|
||||
ShellRunner *shell;
|
||||
} CommandRunner;
|
||||
|
||||
typedef struct UserService {
|
||||
CommandRunner *runner;
|
||||
} UserService;
|
||||
|
||||
void UserService_run(UserService *self, const char *input, size_t len) {
|
||||
(void)input;
|
||||
(void)len;
|
||||
if (!self || !self->runner || !self->runner->shell) {
|
||||
return;
|
||||
}
|
||||
system("true");
|
||||
}
|
||||
26
tests/dynamic_fixtures/class_method/c_recursive_deps/vuln.c
Normal file
26
tests/dynamic_fixtures/class_method/c_recursive_deps/vuln.c
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
/* ClassMethod C fixture with a receiver pointer and recursive struct deps. */
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
typedef struct ShellRunner {
|
||||
int enabled;
|
||||
} ShellRunner;
|
||||
|
||||
typedef struct CommandRunner {
|
||||
ShellRunner *shell;
|
||||
} CommandRunner;
|
||||
|
||||
typedef struct UserService {
|
||||
CommandRunner *runner;
|
||||
} UserService;
|
||||
|
||||
void UserService_run(UserService *self, const char *input, size_t len) {
|
||||
(void)len;
|
||||
if (!self || !self->runner || !self->runner->shell) {
|
||||
return;
|
||||
}
|
||||
char buf[512];
|
||||
snprintf(buf, sizeof(buf), "true %s", input ? input : "");
|
||||
system(buf);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue