diff options
| author | Louis Burda <quent.burda@gmail.com> | 2021-07-08 11:45:02 +0200 |
|---|---|---|
| committer | Louis Burda <quent.burda@gmail.com> | 2021-07-08 11:45:02 +0200 |
| commit | 560218f16b0d4741364a426809fe5b99a9d8ee48 (patch) | |
| tree | 9048982ba3bcc4c42be8ebafca69532af63af956 | |
| parent | 14169f5bc456ec45a746ecd554adfa825a6e9f5a (diff) | |
| download | enowars5-service-stldoctor-560218f16b0d4741364a426809fe5b99a9d8ee48.tar.gz enowars5-service-stldoctor-560218f16b0d4741364a426809fe5b99a9d8ee48.zip | |
fix fmtstr resulting size check
| -rw-r--r-- | do.sh | 2 | ||||
| -rwxr-xr-x | run-proxy.sh | 4 | ||||
| -rw-r--r-- | service/src/util.c | 2 | ||||
| -rw-r--r-- | src/util.c | 2 |
4 files changed, 6 insertions, 4 deletions
@@ -85,7 +85,7 @@ elif [ "$1" == "ci-test" ]; then docker-compose -f service/docker-compose.yml down docker-compose -f checker/docker-compose.yml down elif [ "$1" == "host-local" ]; then - RESULTDIR=service/data/uploads socat -T180 -s TCP-LISTEN:9090,nodelay,reuseaddr,fork \ + RESULTDIR=service/data/uploads socat -x -v -T180 -s TCP-LISTEN:9090,nodelay,reuseaddr,fork \ EXEC:./run-proxy.sh,raw,pty,echo=0,stderr elif [ "$1" == "parse-log" ]; then python3 -c ' diff --git a/run-proxy.sh b/run-proxy.sh index efc1450..eac8748 100755 --- a/run-proxy.sh +++ b/run-proxy.sh @@ -1,3 +1,5 @@ #!/bin/bash -tee /tmp/run-log-in-$$ | valgrind --show-leak-kinds=all --leak-check=full service/src/build/stldoctor 2>/tmp/run-log-err-$$ | tee /tmp/run-log-out-$$ +#tee /tmp/run-log-in-$$ | valgrind --show-leak-kinds=all --leak-check=full service/src/build/stldoctor 2>/tmp/run-log-err-$$ | tee /tmp/run-log-out-$$ + +valgrind --show-leak-kinds=all --leak-check=full service/src/build/stldoctor 2>&1 diff --git a/service/src/util.c b/service/src/util.c index c8274d8..d44e763 100644 --- a/service/src/util.c +++ b/service/src/util.c @@ -32,7 +32,7 @@ aprintf(const char *fmtstr, ...) nb = vsnprintf(NULL, 0, fmtstr, cpy); va_end(cpy); - if (nb <= 0) die("Invalid fmtstr!\n"); + if (nb < 0) die("Invalid fmtstr!\n"); str = checkp(malloc(nb+1)); va_start(ap, fmtstr); @@ -32,7 +32,7 @@ aprintf(const char *fmtstr, ...) nb = vsnprintf(NULL, 0, fmtstr, cpy); va_end(cpy); - if (nb <= 0) die("Invalid fmtstr!\n"); + if (nb < 0) die("Invalid fmtstr!\n"); str = checkp(malloc(nb+1)); va_start(ap, fmtstr); |
