$NetBSD: patch-ah,v 1.1 2005/10/05 11:45:46 salo Exp $ Fix for SA17008, from Gentoo. --- ../convert/eyuvtojpeg.c.orig 1995-04-14 23:16:52.000000000 +0200 +++ ../convert/eyuvtojpeg.c 2005-10-05 13:20:02.000000000 +0200 @@ -24,6 +24,7 @@ *==============*/ #include #include +#include #include typedef unsigned char uint8; @@ -46,8 +47,9 @@ void main(int argc, char **argv) { FILE *fpointer; - char command[256]; - char src[256], dest[256]; + char command[4096]; + char src[4096], dest[4096], tempfile[4096]; + int ret; if ((strcmp(argv[1],"-?") == 0) || (strcmp(argv[1],"-h") == 0) || @@ -98,13 +100,16 @@ YUVtoPPM(); fprintf(stdout, "Writing PPM\n"); - fpointer = fopen("/tmp/foobar", "w"); + sprintf(tempfile, "%s.tmp", dest); + fpointer = fopen(tempfile, "w"); WritePPM(fpointer); fclose(fpointer); fprintf(stdout, "Converting to JPEG %s\n", dest); - sprintf(command, "cjpeg /tmp/foobar > %s", dest); - system(command); + sprintf(command, "cjpeg %s > %s", tempfile, dest); + ret = system(command); + unlink(tempfile); + return ret; }