xli/xli-1.17.0-overflow.patch
OBS User autobuild 9c00e9ec33 Accepting request 39242 from X11:Utilities
Copy from X11:Utilities/xli based on submit request 39242 from user prusnak

OBS-URL: https://build.opensuse.org/request/show/39242
OBS-URL: https://build.opensuse.org/package/show/openSUSE:Factory/xli?expand=0&rev=9
2010-05-03 19:28:21 +00:00

93 lines
3.0 KiB
Diff

Index: ddxli.h
===================================================================
--- ddxli.h.orig
+++ ddxli.h
@@ -36,11 +36,13 @@
/* equate bcopy with memcpy and bzero with memset where appropriate. */
#ifdef HAS_MEMCPY
+#ifndef __linux__
#ifndef bcopy
#define bcopy(S,D,N) memcpy((char *)(D),(char *)(S),(N))
#endif
#ifndef bzero
#define bzero(P,N) memset((P),'\0',(N))
+#endif /* __linux__ */
#endif
#ifndef bfill
#define bfill(P,N,C) memset((P),(C),(N))
Index: faces.c
===================================================================
--- faces.c.orig
+++ faces.c
@@ -56,9 +56,15 @@ isFaces(ZFILE *zf, char *name, char *fna
if (! strcmp(buf, "\n"))
break;
if (!strncmp(buf, "FirstName:", 10))
- strcpy(fname, buf + 11);
+ {
+ strncpy(fname, buf + 11, BUFSIZ - 1);
+ fname[BUFSIZ - 1] = '\0';
+ }
else if (!strncmp(buf, "LastName:", 9))
- strcpy(lname, buf + 10);
+ {
+ strncpy(lname, buf + 10, BUFSIZ - 1);
+ lname[BUFSIZ - 1] = '\0';
+ }
else if (!strncmp(buf, "Image:", 6)) {
if (sscanf(buf + 7, "%d%d%d", &iw, &ih, &id) != 3) {
fprintf(stderr,"facesLoad: %s - Bad image\n", name);
Index: reduce.c
===================================================================
--- reduce.c.orig
+++ reduce.c
@@ -178,7 +178,8 @@ Image *reduce(Image *image, unsigned col
/* get destination image */
depth = colorsToDepth(OutColors);
new_image = newRGBImage(image->width, image->height, depth);
- sprintf(buf, "%s (%d colors)", image->title, OutColors);
+ snprintf(buf, BUFSIZ, "%s (%d colors)", image->title, OutColors);
+ buf[BUFSIZ-1] = '\0';
new_image->title = dupString(buf);
new_image->gamma = image->gamma;
Index: zoom.c
===================================================================
--- zoom.c.orig
+++ zoom.c
@@ -52,28 +52,29 @@ Image *zoom(Image *oimage, unsigned int
if (verbose)
printf(" Zooming image Y axis by %d%%...", yzoom);
if (changetitle)
- sprintf(buf, "%s (Y zoom %d%%)", oimage->title, yzoom);
+ snprintf(buf, BUFSIZ, "%s (Y zoom %d%%)", oimage->title, yzoom);
}
else if (!yzoom) {
if (verbose)
printf(" Zooming image X axis by %d%%...", xzoom);
if (changetitle)
- sprintf(buf, "%s (X zoom %d%%)", oimage->title, xzoom);
+ snprintf(buf, BUFSIZ, "%s (X zoom %d%%)", oimage->title, xzoom);
}
else if (xzoom == yzoom) {
if (verbose)
printf(" Zooming image by %d%%...", xzoom);
if (changetitle)
- sprintf(buf, "%s (%d%% zoom)", oimage->title, xzoom);
+ snprintf(buf, BUFSIZ, "%s (%d%% zoom)", oimage->title, xzoom);
}
else {
if (verbose)
printf(" Zooming image X axis by %d%% and Y axis by %d%%...",
xzoom, yzoom);
if (changetitle)
- sprintf(buf, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
+ snprintf(buf, BUFSIZ, "%s (X zoom %d%% Y zoom %d%%)", oimage->title,
xzoom, yzoom);
}
+ buf[BUFSIZ-1] = '\0';
if (!changetitle)
strcpy(buf,oimage->title);