3d9823b9a4
The code in question uses an improvised "strntoul" function (hidden behind the GET_NUM_FIELD macro) which returns "int". int cpioHeaderRead(FSM_t fsm, struct stat * st) ... GET_NUM_FIELD(hdr.filesize, st->st_size); When a file size undergoes an "int bottleneck", it cannot be safely converted back to an unsigned 64-bit integer. By the C rules, if the size is in the range 2G..4G-1, int becomes negative (or this may be undefined behaviour already, I'm not a language lawyer), and conversion to unsigned 64-bit is performed as if by adding 2^64 to the negative value. So you get a huge 64-bit file size. Funnily enough, if you truncate it to 32 bits, it's back to normal! That's why things worked with 32-bit size_t. static int expandRegular(/*@special@*/ FSM_t fsm) ... size_t left = st->st_size; |
||
---|---|---|
.gear | ||
autodeps | ||
build | ||
doc | ||
lib | ||
po | ||
python | ||
rpmdb | ||
rpmio | ||
scripts | ||
tools | ||
.gitignore | ||
.lclintrc | ||
build.c | ||
build.h | ||
CHANGES | ||
configure.ac | ||
COPYING | ||
CREDITS | ||
debug.h | ||
Doxyfile.in | ||
Doxyheader | ||
gendiff | ||
GROUPS | ||
INSTALL | ||
installplatform | ||
macros.in | ||
Makefile.am | ||
platform.in | ||
README | ||
README.ALT-ru_RU.UTF-8 | ||
rpm2cpio.c | ||
rpm-4_0.spec | ||
rpm-build.buildreq | ||
rpminit | ||
rpminit.1 | ||
rpmpopt.in | ||
rpmqv.c | ||
rpmrc.in | ||
system.h | ||
TODO |
This is RPM, the Red Hat Package Manager. The latest releases are always available at: ftp://ftp.rpm.org/pub/rpm Additional RPM documentation (papers, slides, HOWTOs) can also be found at the same site, as well as http://www.rpm.org. There is a mailing list for discussion of RPM issues, rpm-list@redhat.com. To subscribe, send a message to rpm-list-request@redhat.com with the word "subscribe" in the subject line. RPM was originally written by: Erik Troan <ewt@redhat.com> Marc Ewing <marc@redhat.com> See the CREDITS file for a list of folks who have helped us out tremendously. RPM is Copyright (c) 1998 by Red Hat Software, Inc., and may be distributed under the terms of the GPL and LGPL (see the file COPYING for details).