]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
[Bug 377] Some PDF files will cause sendfax to segfault
authorDarren Nickerson <darren.nickerson@ifax.com>
Sun, 9 Feb 2003 02:46:02 +0000 (02:46 +0000)
committerDarren Nickerson <darren.nickerson@ifax.com>
Sun, 9 Feb 2003 02:46:02 +0000 (02:46 +0000)
Now they won't. Thanks Patrice!

util/SendFaxClient.c++

index 6946c6d8f0b456958291c9c75e41050b4f480a0a..fa6c69b4d23299a73a485624849f99ecb2a3faf4 100644 (file)
@@ -783,7 +783,7 @@ SendFaxClient::estimatePostScriptPages(const char* filename)
                rewind(fd);
                char *cp = line;
                int len;
-               while ((len = fread(cp, 1, endbuf-cp, fd)) > 0) {
+               while ((len = fread(cp, 1, endbuf-cp, fd)) > slen+line-cp) {
                     endbuf = cp+len;    // Will only change on the last pass.
                    cp = line;
                    while ((cp = (char *) memchr(cp, '/', endbuf-cp-slen))) {