commit - 58578a1a5cba826572864b8a62787325b5120b1e
commit + 41873b17dbf689280a2f59f9e7187205a5b358f2
blob - 2bb13ec800c4d056689ef15d9179ab3d8151a359
blob + 84302f45b8db014cc23483d23a273c03f7fa077c
--- lib/pack.c
+++ lib/pack.c
if (pack->map) {
size_t mapoff;
- if (delta_offset + *len > SIZE_MAX) {
+ if (delta_offset > SIZE_MAX - *len) {
return got_error_fmt(GOT_ERR_PACK_OFFSET,
"mapoff %lld would overflow size_t",
(long long)delta_offset + *len);
if (pack->map) {
size_t mapoff;
- if (delta_offset + tslen > SIZE_MAX) {
+ if (delta_offset > SIZE_MAX - tslen) {
return got_error_fmt(GOT_ERR_PACK_OFFSET,
"mapoff %lld would overflow size_t",
(long long)delta_offset + tslen);