summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'sys-apps/slocate/files/slocate-2.7-bounds.patch')
-rw-r--r--sys-apps/slocate/files/slocate-2.7-bounds.patch16
1 files changed, 16 insertions, 0 deletions
diff --git a/sys-apps/slocate/files/slocate-2.7-bounds.patch b/sys-apps/slocate/files/slocate-2.7-bounds.patch
new file mode 100644
index 000000000000..b370d12842e6
--- /dev/null
+++ b/sys-apps/slocate/files/slocate-2.7-bounds.patch
@@ -0,0 +1,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;