]> git.ipfire.org Git - thirdparty/HylaFAX.git/commitdiff
Bug 644
authorAidan Van Dyk <aidan@ifax.com>
Fri, 1 Apr 2005 20:57:24 +0000 (20:57 +0000)
committerAidan Van Dyk <aidan@ifax.com>
Fri, 1 Apr 2005 20:57:24 +0000 (20:57 +0000)
FaxClient::makeHeader() segfaults on improper format strings

util/FaxClient.c++

index 7785577ea03870293298e8a982c69419e9d748be..0bee7ad4d67785529f5b993b5ef428cc263c4466 100644 (file)
@@ -1537,6 +1537,8 @@ FaxClient::makeHeader(const char* fmt, const FaxFmtHeader fmts[], fxStr& header)
            char* fp = fspec;
            *fp++ = '%';
            char c = *++cp;
+           if (c == '\0')
+               break;
            if (c == '-')
                *fp++ = c, c = *++cp;
            if (isdigit(c)) {