Skip to content
Permalink
Browse files Browse the repository at this point in the history
Check for int underflow in imap_quote_string
  • Loading branch information
jeriko-one authored and flatcap committed Jul 7, 2018
1 parent 3c49c44 commit 65d64a5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions imap/util.c
Expand Up @@ -821,9 +821,9 @@ void imap_quote_string(char *dest, size_t dlen, const char *src, bool quote_back
{
if (strchr(quote, *s))
{
dlen -= 2;
if (dlen == 0)
if (dlen < 2)
break;
dlen -= 2;
*pt++ = '\\';
*pt++ = *s;
}
Expand Down

0 comments on commit 65d64a5

Please sign in to comment.