]> diplodocus.org Git - nmh/commitdiff
Fix invalid pointer arithmetic.
authorKen Hornstein <kenh@pobox.com>
Fri, 27 Oct 2017 01:53:58 +0000 (21:53 -0400)
committerKen Hornstein <kenh@pobox.com>
Fri, 27 Oct 2017 01:53:58 +0000 (21:53 -0400)
Reported by David Levine.

uip/imaptest.c

index 0fa5e26..f937cb5 100644 (file)
@@ -417,7 +417,7 @@ parse_capability(const char *cap, unsigned int len)
     }
 
     for (i = 0; caplist[i] != NULL; i++) {
-       if (has_prefix(caplist[i], "AUTH=") && caplist[i] + 5 != '\0') {
+       if (has_prefix(caplist[i], "AUTH=") && *(caplist[i] + 5) != '\0') {
            if (saslmechs) {
                saslmechs = add(" ", saslmechs);
            }
@@ -709,7 +709,7 @@ getline:
            if (has_prefix(line, cmdqueue->tag)) {
                cmd = cmdqueue;
                if (timestamp)
-                   ts_report("Command execution time:", &cmd->start);
+                   ts_report("Command execution time", &cmd->start);
                cmdqueue = cmd->next;
                free(cmd);
            } else {