diff options
author | jbj <devnull@localhost> | 2001-04-17 18:23:58 +0000 |
---|---|---|
committer | jbj <devnull@localhost> | 2001-04-17 18:23:58 +0000 |
commit | c360a8907b132495e411824c92dfe4189e76ac3d (patch) | |
tree | f36c38ca27bf9eb759721fbff70d27ed3dcc8f91 | |
parent | 1ea9d2cf9d4a58f2c5cf0489a326dbb495e613a0 (diff) | |
download | librpm-tizen-c360a8907b132495e411824c92dfe4189e76ac3d.tar.gz librpm-tizen-c360a8907b132495e411824c92dfe4189e76ac3d.tar.bz2 librpm-tizen-c360a8907b132495e411824c92dfe4189e76ac3d.zip |
- fix: s390 (and ppc?) could return CPIOERR_BAD_HEADER (#28645).
CVS patchset: 4682
CVS date: 2001/04/17 18:23:58
-rw-r--r-- | CHANGES | 1 | ||||
-rw-r--r-- | lib/cpio.c | 4 |
2 files changed, 3 insertions, 2 deletions
@@ -24,6 +24,7 @@ - fix: --excludedoc shouldn't create empty doc dir (#14531). - fix: %_netsharedpath needs to look at basenames (#26561). - fix: --excludepath was broken (#24434). + - fix: s390 (and ppc?) could return CPIOERR_BAD_HEADER (#28645). 4.0 -> 4.0.[12] - add doxygen and lclint annotations most everywhere. diff --git a/lib/cpio.c b/lib/cpio.c index f633e66ee..fa5c8b100 100644 --- a/lib/cpio.c +++ b/lib/cpio.c @@ -50,14 +50,14 @@ static int strntoul(const char *str, /*@out@*/char **endptr, int base, int num) if (*end) *endptr = ((char *)str) + (end - buf); /* XXX discards const */ else - *endptr = ((char *)str) + strlen(str); + *endptr = ((char *)str) + strlen(buf); return ret; } #define GET_NUM_FIELD(phys, log) \ log = strntoul(phys, &end, 16, sizeof(phys)); \ - if (*end) return CPIOERR_BAD_HEADER; + if ( (end - phys) != sizeof(phys) ) return CPIOERR_BAD_HEADER; #define SET_NUM_FIELD(phys, val, space) \ sprintf(space, "%8.8lx", (unsigned long) (val)); \ memcpy(phys, space, 8); |