[Rpm-maint] [rpm-software-management/rpm] Fix IMA signature lengths assumed constant (#1833, RhBug:2018937) (PR #1844)

Michal Domonkos notifications at github.com
Mon Dec 6 14:13:10 UTC 2021


@dmnks commented on this pull request.



>  	const char *s;
 
+	/* Figure string sizes + max length for allocation purposes */
+	if (lengths) {
+	    int maxl = 0;
+	    int *lens = xmalloc(num * sizeof(*lens));
+	    int i = 0;
+
+	    while ((s = rpmtdNextString(&td))) {
+		lens[i] = strlen(s) / 2;

I guess the assumption here is that a hex string will always be even (one byte is represented by two chars), but otherwise yeah, we should probably have a check here.

-- 
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/1844#discussion_r763041806
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20211206/1afeafda/attachment.html>


More information about the Rpm-maint mailing list