summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNed Ludd <solar@gentoo.org>2004-11-14 04:37:24 +0000
committerNed Ludd <solar@gentoo.org>2004-11-14 04:37:24 +0000
commitdb5145afd047198c0cfd58b54ca88ce6f089ebea (patch)
tree5d079a5c89b0f0ba7cceb220ec7cc638de0aa9f3 /sys-apps/file/files
parentsh KEYWORDS (Manifest recommit) (diff)
downloadgentoo-2-db5145afd047198c0cfd58b54ca88ce6f089ebea.tar.gz
gentoo-2-db5145afd047198c0cfd58b54ca88ce6f089ebea.tar.bz2
gentoo-2-db5145afd047198c0cfd58b54ca88ce6f089ebea.zip
fixed off by one bug in file-4.10
Diffstat (limited to 'sys-apps/file/files')
-rw-r--r--sys-apps/file/files/file-4.10-mconvert.patch18
1 files changed, 18 insertions, 0 deletions
diff --git a/sys-apps/file/files/file-4.10-mconvert.patch b/sys-apps/file/files/file-4.10-mconvert.patch
new file mode 100644
index 000000000000..9d1a6e157bab
--- /dev/null
+++ b/sys-apps/file/files/file-4.10-mconvert.patch
@@ -0,0 +1,18 @@
+--- src/softmagic.c.orig 2004-11-13 03:07:49.000000000 -0500
++++ src/softmagic.c 2004-11-13 03:27:20.000000000 -0500
+@@ -427,12 +427,12 @@ mconvert(struct magic_set *ms, union VAL
+ return 1;
+ case FILE_STRING:
+ {
+- int n;
++ size_t n;
+
+ /* Null terminate and eat *trailing* return */
+ p->s[sizeof(p->s) - 1] = '\0';
+- n = strlen(p->s) - 1;
+- if (p->s[n] == '\n')
++ n = strlen(p->s);
++ if (n-- && p->s[n] == '\n')
+ p->s[n] = '\0';
+ return 1;
+ }