Skip to content

Commit 934e385

Browse files
committed
gd: change uses of sprintf into snprintf
1 parent 7e2d47d commit 934e385

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/gd/libgd/gd_gif_in.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ GetDataBlock(gdIOCtx *fd, unsigned char *buf, int *ZeroDataBlockP)
360360
if (rv > 0) {
361361
tmp = safe_emalloc(3 * rv, sizeof(char), 1);
362362
for (i=0;i<rv;i++) {
363-
sprintf(&tmp[3*sizeof(char)*i], " %02x", buf[i]);
363+
snprintf(tmp + 3 * i, 4, " %02x", buf[i]);
364364
}
365365
} else {
366366
tmp = estrdup("");

0 commit comments

Comments
 (0)