Import of pkgsrc-2015Q2

This commit is contained in:
2015-08-30 02:56:09 -07:00
committed by Lionel Sambuc
parent 4af1cdf7a9
commit f641581404
15409 changed files with 267784 additions and 121624 deletions

View File

@@ -0,0 +1,20 @@
$NetBSD: patch-src_softmagic.c,v 1.1 2015/05/23 13:11:07 bsiegert Exp $
contains fix from
https://github.com/file/file/commit/3046c231e1a2fcdd5033bea0603c23f435a00bd7
--- src/softmagic.c.orig 2015-01-01 17:07:34.000000000 +0000
+++ src/softmagic.c
@@ -1116,10 +1116,8 @@ mcopy(struct magic_set *ms, union VALUET
bytecnt = m->str_range;
}
- if (bytecnt == 0)
- bytecnt = 8192;
- if (bytecnt > nbytes)
- bytecnt = nbytes;
+ if (bytecnt == 0 || bytecnt > nbytes - offset)
+ bytecnt = nbytes - offset;
buf = RCAST(const char *, s) + offset;
end = last = RCAST(const char *, s) + bytecnt;