freebsd-ports/graphics/xli/files/patch-tga.c
Joseph Koshy 15326114dc Fix a few potential buffer overflows in this port.
Security:	CAN-2005-3178 (for xloadimage)
Prodded by:	naddy
2005-10-21 08:15:53 +00:00

11 lines
321 B
C

--- tga.c.orig Thu Oct 13 04:41:39 2005
+++ tga.c Thu Oct 13 04:42:08 2005
@@ -116,7 +116,7 @@
char colors[40];
if (hp->ImgType == TGA_Map || hp->ImgType == TGA_RLEMap)
- sprintf(colors," with %d colors",hp->Length);
+ snprintf(colors,sizeof(colors)," with %d colors",hp->Length);
else
colors[0] = '\000';