@DemiMarie commented on this pull request.


> @@ -467,15 +468,14 @@ static int dataLength(rpm_tagtype_t type, 
> rpm_constdata_t p, rpm_count_t count,
        break;
 
     default:
-       if (typeSizes[type] == -1)
-           return -1;
-       length = typeSizes[(type & 0xf)] * count;
-       if (length < 0 || (se && (s + length) > se))
+       /* this won’t overflow, since ‘long_count’ is 64-bit */
+       length = typeSizes[type] * long_count;
+       if (length <= 0 || (se && length > se - s))

I went with making `typeSizes` 64-bit, which will help prevent similar problems 
elsewhere.

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/1492#discussion_r579012812
_______________________________________________
Rpm-maint mailing list
Rpm-maint@lists.rpm.org
http://lists.rpm.org/mailman/listinfo/rpm-maint

Reply via email to