chiark / gitweb /
util: priomsg: Allow passing priomsg_update_p a null pm
[secnet.git] / util.c
diff --git a/util.c b/util.c
index bcc24bdc637d828245bb6f8173863e91d6d9b490..241196227a80cd71e655daea6d5368fabadf37dd 100644 (file)
--- a/util.c
+++ b/util.c
@@ -413,6 +413,7 @@ void priomsg_reset(struct priomsg *pm)
 }
 bool_t priomsg_update_p(struct priomsg *pm, int prio)
 {
+    if (!pm) return False;
     if (prio <= pm->prio) return False;
     buffer_init(&pm->m, 0);
     pm->prio = prio;