Skip to content

Commit

Permalink
rfc2047: blaze822_decode_rfc2047: account for space for trailing nul
Browse files Browse the repository at this point in the history
  • Loading branch information
leahneukirchen committed Mar 2, 2019
1 parent 081a940 commit 023c26f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions rfc2047.c
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,10 @@ blaze822_decode_rfc2047(char *dst, char *src, size_t dlen, char *tgtenc)
iconv_t ic = (iconv_t)-1;
char *srcenc = 0;

// need space for trailing nul
if (dlen-- == 0)
return 0;

char *startdst = dst;
size_t startdlen = dlen;

Expand Down

0 comments on commit 023c26f

Please sign in to comment.