diff --git a/tests/heapfunn b/tests/heapfunn index 5e9b4927..c3f7405d 100755 Binary files a/tests/heapfunn and b/tests/heapfunn differ diff --git a/tests/heapfunn.c b/tests/heapfunn.c index aa037fae..c8e3db4b 100644 --- a/tests/heapfunn.c +++ b/tests/heapfunn.c @@ -6,21 +6,22 @@ char *bufs[NUMBUFS]; int main() { unsigned int bufnum, size, haxx, i; + int ret; for (i = 0; i < NUMBUFS; i++) bufs[i] = NULL; printf("exploit me bro\n"); fflush(stdout); while (1) { - read(0, &bufnum, sizeof(bufnum)); + ret = read(0, &bufnum, sizeof(bufnum)); if (ret <= 0) break; if (bufnum >= NUMBUFS) continue; - read(0, &size, sizeof(size)); - read(0, &haxx, sizeof(haxx)); + ret = read(0, &size, sizeof(size)); if (ret <= 0) break; + ret = read(0, &haxx, sizeof(haxx)); if (ret <= 0) break; if (size == 0) { if (bufs[bufnum] != NULL) free(bufs[bufnum]); bufs[bufnum] = NULL; } else { bufs[bufnum] = (char *)malloc(size); if (bufs[bufnum] != NULL) { - int r = read(0, bufs[bufnum], size); + ret = read(0, bufs[bufnum], size); if (ret <= 0) break; if (haxx) { bufs[bufnum][size] = '\0'; }