summaryrefslogtreecommitdiff
blob: b370d12842e6120c41d46af0c276ea64611423d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
Snatched from Fedora.

--- slocate-2.7/main.c
+++ slocate-2.7/main.c
@@ -1265,6 +1265,11 @@
 
 		pathlen = code_ptr - codedpath;
 
+		if (pathlen < 0) {
+			fprintf(stderr,"%s: decode_db() aborted. Corrupt database?\n",progname);
+			exit(1);
+		}
+		
 		jump = 0;
 		while (!jump) {
 			ch = *begin_ptr;