diff options
| author | Root THC | 2026-02-24 12:42:47 +0000 |
|---|---|---|
| committer | Root THC | 2026-02-24 12:42:47 +0000 |
| commit | c9cbeced5b3f2bdd7407e29c0811e65954132540 (patch) | |
| tree | aefc355416b561111819de159ccbd86c3004cf88 /exploits/7350855/readtest.c | |
| parent | 073fe4bf9fca6bf40cef2886d75df832ef4b6fca (diff) | |
initial
Diffstat (limited to 'exploits/7350855/readtest.c')
| -rw-r--r-- | exploits/7350855/readtest.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/exploits/7350855/readtest.c b/exploits/7350855/readtest.c new file mode 100644 index 0000000..f1618e5 --- /dev/null +++ b/exploits/7350855/readtest.c | |||
| @@ -0,0 +1,42 @@ | |||
| 1 | |||
| 2 | #include <stdio.h> | ||
| 3 | #include <stdlib.h> | ||
| 4 | #include <unistd.h> | ||
| 5 | #include "network.h" | ||
| 6 | |||
| 7 | |||
| 8 | int | ||
| 9 | main (int argc, char *argv[]) | ||
| 10 | { | ||
| 11 | int cfd; | ||
| 12 | bound * rt; | ||
| 13 | int len; | ||
| 14 | unsigned char tbuf[8192]; | ||
| 15 | |||
| 16 | |||
| 17 | rt = net_bind (NULL, 2000); | ||
| 18 | if (rt == NULL) { | ||
| 19 | perror ("net_bind"); | ||
| 20 | exit (EXIT_FAILURE); | ||
| 21 | } | ||
| 22 | |||
| 23 | cfd = net_accept (rt->bs, NULL, 0); | ||
| 24 | if (cfd <= 0) { | ||
| 25 | perror ("net_accept"); | ||
| 26 | exit (EXIT_FAILURE); | ||
| 27 | } | ||
| 28 | |||
| 29 | /* now deep down to the guts */ | ||
| 30 | len = 1; | ||
| 31 | while (len > 0 && 1) { | ||
| 32 | len = read (cfd, tbuf, sizeof (tbuf)); | ||
| 33 | printf ("%d\n", len); | ||
| 34 | } | ||
| 35 | |||
| 36 | close (cfd); | ||
| 37 | net_boundfree (rt); | ||
| 38 | |||
| 39 | exit (EXIT_SUCCESS); | ||
| 40 | } | ||
| 41 | |||
| 42 | |||
