[Rpm-maint] [rpm-software-management/rpm] Add Key Fingerprints to rpmsinfoMsg() (PR #3321)

Panu Matilainen notifications at github.com
Wed Oct 2 05:53:56 UTC 2024


@pmatilai commented on this pull request.



>  
 	/* Returned to C, can't use new */
 	subkeys = (rpmPubkey *)xmalloc(pgpsubkeysCount * sizeof(*subkeys));
-	for (i = 0; i < pgpsubkeysCount; i++)
-	    subkeys[i] = rpmPubkeyNewSubkey(pgpsubkeys[i]);
+	for (i = 0; i < pgpsubkeysCount; i++) {
+	    subkeys[i] = rpmPubkeyNewSubkey(primarykey, pgpsubkeys[i]);
+	    primarykey->nrefs++; /* can't use rpmPubkeyLink due to wrlock */

The common practise across the codebase is to leave the rpm-prefix out of such internal functions (rpmstrpool has examples too), so it'd be just pubkeyLink(). And those commonly don't check for NULL either, it's expected that the caller knows what they're doing.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/rpm-software-management/rpm/pull/3321#discussion_r1783870148
You are receiving this because you are subscribed to this thread.

Message ID: <rpm-software-management/rpm/pull/3321/review/2341941584 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20241001/0492e175/attachment.html>


More information about the Rpm-maint mailing list