[Rpm-maint] [rpm-software-management/rpm] Extend dbus-announce plugin (PR #3532)

mcrha notifications at github.com
Mon Feb 10 16:41:29 UTC 2025


@mcrha commented on this pull request.



> +        case TR_REMOVED:
+            op = "removed";
+            break;
+        case TR_RPMDB:
+            op = "rpmdb";
+            break;
+        case TR_RESTORED:
+            op = "restored";
+            break;
+        }
+        buffln = strlen(op) + 1 + strlen(nevra) + 1;
+        buff = (char *) malloc(sizeof(char) * buffln);
+        if (buff == NULL)
+            goto err;
+	/* encode as "operation SPACE nevra" */
+	snprintf(buff, buffln, "%s %s", op, nevra);

if you want, I can do it, though the `snprintf` helps to avoid buffer overflow, which is a good thing, I believe

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

Message ID: <rpm-software-management/rpm/pull/3532/review/2606509986 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rpm.org/pipermail/rpm-maint/attachments/20250210/ef972bb9/attachment.htm>


More information about the Rpm-maint mailing list