From: Simo S. <sim...@ti...> - 2001-02-03 15:29:13
|
Hongli Lai wrote: > > Please test it a little and send me bug reports if you find any. > > There's one critical bug in LibGarp. > When I try to open a file not supported by LibGarp, it will execute an > infinite loop and eat up all your memory if you don't CTRL+C it. > Could somebody look at it? > I think I've fixed it. There were a couple of bugs in garp-zip.c and garp-formats.c garp-zip: if the ziplib returned the need for multiple disk or last disk the app cycled endlessly tring to feed the same invalid file name instead of exiting!! garp-formats: missed the test to be sure an extension was found. If a filename without extension were passed, than the routine uncorrectly reported garp_zip_new as handler instead of null!! code: I think I have still problems with sourceforge cvs (other cvs work fine for me), it seem they decided user idra does not need a home :( so I will send you the patch over the list Bye, Simo. Index: garp-zip.c =================================================================== RCS file: /cvsroot/arpix/libgarp/src/garp-zip.c,v retrieving revision 1.19 diff -r1.19 garp-zip.c 184,185c184,185 < filename = archive->filename; < goto readzip; --- > zlfree (f); > return GARP_ARCHIVE_LIST_MULTI_DISK; 189,191c189,192 < filename = archive->filename; /* FIXME: implement this */ < goto readzip; < } else if (i != ZLINIT_OK) --- > zlfree (f); /* FIXME: implement this */ > return GARP_ARCHIVE_LIST_MULTI_DISK; > } > else if (i != ZLINIT_OK) Index: garp-formats.c =================================================================== RCS file: /cvsroot/arpix/libgarp/src/garp-formats.c,v retrieving revision 1.8 diff -r1.8 garp-formats.c 121a122 > if (!extension) return NULL; 131a133 > if (!extension) return NULL; 182c184 < #endif _GARP_FORMATS_H_ \ No newline at end of file --- > #endif _GARP_FORMATS_H_ -- sim...@ti... http://www.geocities.com/SiliconValley/9757 |