Skip to content

Commit

Permalink
[Debian bug 474298 484352] Fixed off-by-1 memory allocation error.
Browse files Browse the repository at this point in the history
Allocate one more byte to allow for double terminating NUL bytes.
  • Loading branch information
BuGlessRB committed Mar 2, 2022
1 parent 570ef09 commit 990f9d4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mailfold.c
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ int writefolder(boxname,linkfolder,source,len,ignwerr,dolock)
if(linkfolder) /* any additional directories specified? */
{ size_t blen;
if(blen=Tmnate-linkfolder) /* copy the names into safety */
Tmnate=(linkfolder=tmemmove(malloc(blen),linkfolder,blen))+blen;
Tmnate=(linkfolder=tmemmove(malloc(blen+1),linkfolder,blen))+blen;
else
linkfolder=0;
}
Expand Down

0 comments on commit 990f9d4

Please sign in to comment.