Skip to content

Commit 4646e76

Browse files
committed
Fix potential buffer overflow (noticed by libasan)
1 parent 1724302 commit 4646e76

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/uudecode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int uudecode(FILE *input, /* get file data from (if needed) */
7575
if (init) {
7676
/* search for header line */
7777
/* AUDIT biege: BOF in buf! */
78-
sprintf(scanfstring, "begin %%o %%%us", sizeof(buf));
78+
sprintf(scanfstring, "begin %%o %%%us", sizeof(buf) -1);
7979
while (2 != sscanf(iptr, scanfstring, &mode, buf)) {
8080
if (!fgets(buf, MAXPATHLEN, input)) {
8181
return 2;

0 commit comments

Comments
 (0)