freebsd-ports/graphics/xli/files/patch-reduce.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
436 B
C

--- reduce.c.orig Thu Oct 13 04:36:44 2005
+++ reduce.c Thu Oct 13 04:37:02 2005
@@ -178,7 +178,7 @@
/* get destination image */
depth = colorsToDepth(OutColors);
new_image = newRGBImage(image->width, image->height, depth);
- sprintf(buf, "%s (%d colors)", image->title, OutColors);
+ snprintf(buf, sizeof(buf), "%s (%d colors)", image->title, OutColors);
new_image->title = dupString(buf);
new_image->gamma = image->gamma;