file 4.17 preview...

Christos Zoulas christos at zoulas.com
Fri Mar 3 21:05:19 EET 2006


On Mar 2, 11:56pm, vapier at gentoo.org (Mike Frysinger) wrote:
-- Subject: Re: file 4.17 preview...

 
| i dont remember what patches these were :), but the attached test case by Erik 
| Thiele still fails with file-4.17 ...
| -mike

Ah, not one, but two bugs to fix this one :-)

christos

===================================================================
RCS file: /src/pub/file/src/ascmagic.c,v
retrieving revision 1.44
diff -u -u -r1.44 ascmagic.c
--- ascmagic.c	2 Mar 2006 22:08:22 -0000	1.44
+++ ascmagic.c	3 Mar 2006 19:04:17 -0000
@@ -154,8 +154,10 @@
 		}
 	}
 
-	if (nbytes <= 1)
+	if (nbytes <= 1) {
+		rv = 0;
 		goto done;
+	}
 
 	/*
 	 * for troff, look for . + letter + letter or .\";
Index: softmagic.c
===================================================================
RCS file: /src/pub/file/src/softmagic.c,v
retrieving revision 1.77
diff -u -u -r1.77 softmagic.c
--- softmagic.c	20 Oct 2005 14:59:01 -0000	1.77
+++ softmagic.c	3 Mar 2006 19:04:17 -0000
@@ -664,6 +664,11 @@
 		 * (starting at 1), not as bytes-from start-of-file
 		 */
 		char *b, *c, *last = NULL;
+		if (s == NULL) {
+			p->search.buflen = 0;
+			p->search.buf = NULL;
+			return 0;
+		}
 		if ((p->search.buf = strdup((const char *)s)) == NULL) {
 			file_oomem(ms);
 			return -1;



More information about the File mailing list