]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-polkit: add one more assertion
authorYu Watanabe <watanabe.yu+github@gmail.com>
Tue, 17 Feb 2026 07:39:35 +0000 (16:39 +0900)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 27 Feb 2026 21:57:05 +0000 (21:57 +0000)
For CID#1645013.

(cherry picked from commit ce6ea42b699d060f3c792d2ae68dea73c2e1e342)
(cherry picked from commit 3de098447a9dfe7905dad5ce04972e5b08e5baf6)
(cherry picked from commit 3ea611db0026d577f7d85881a06d1157da731d91)

src/shared/bus-polkit.c

index 4cdb607d12d4ee00e7bd83e395f2fa90a30bd707..75d436c5e1edbfd9f377005611980a277c814906 100644 (file)
@@ -275,9 +275,7 @@ static int async_polkit_read_reply(sd_bus_message *reply, AsyncPolkitQuery *q) {
         a = ASSERT_PTR(TAKE_PTR(q->action));
 
         if (sd_bus_message_is_method_error(reply, NULL)) {
-                const sd_bus_error *e;
-
-                e = sd_bus_message_get_error(reply);
+                const sd_bus_error *e = ASSERT_PTR(sd_bus_message_get_error(reply));
 
                 if (bus_error_is_unknown_service(e)) {
                         /* If PK is absent, then store this away, as it depends on the callers flags whether