Commit Graph

7 Commits

Author SHA1 Message Date
Alexey Tourbin
5eb85a7a5e signature.c: change file size fmt %d -> %zu
Some of the preceding code is probably undefined or unspecified behavior,
but there's no easy way to fix it other than rewriting, which I'm not
going to do.  Surprisingly enough, the code just happens to work, due to
a series of mutual cancellations mod 2^32.  As they say in Russian,
the war will write off all.  Likewise, mod 2^32 arithmetic can write off
a multitude of sins (James 5:20).

> static inline rpmRC checkSize(FD_t fd, int siglen, int pad, int datalen)
[...]
>     int delta;
[...]
>     delta = (sizeof(struct rpmlead) + siglen + pad + datalen) - st.st_size;

Here, the expression in parentheses yields a different numeric value
depending on whether datalen is signed or unsigned.  However, when delta
is finally truncated to 32 bits, the result turns out to be the same.

>     switch (delta) {
>     case -32:	/* XXX rpm-4.0 packages */
>     case 32:	/* XXX Legacy headers have a HEADER_IMAGE tag added. */
>     case 0:
2018-06-26 12:42:44 +03:00
fe6df19341 build/files.c, lib/signature.c: Do not include unused md5.h 2008-10-20 11:39:45 +00:00
58e1dad6cc fixed compilation warnings 2003-11-24 18:59:03 +00:00
349f25715c updated code to snapshot 2002-04-19 2002-04-22 17:06:31 +00:00
1ce2c1a667 sync with rpm4 branch 2002-03-26 00:56:54 +00:00
dee952c2f8 sync with rpm4 branch: include local headers 2002-03-25 22:02:39 +00:00
82a4763c66 Initial revision 2002-03-25 20:16:26 +00:00