The MSG_MAGICAL() macro needs to check for a NULL pointer
prior to calling strncmp on it.
Signed-off-by: Dmitry Torokhov <dtor@vmware.com>
// the X hides MSG_MAGIC so it won't appear in the object file
-#define MSG_MAGICAL(s) (strncmp(s, MSG_MAGIC"X", MSG_MAGIC_LEN) == 0)
+#define MSG_MAGICAL(s) \
+ (s != NULL && strncmp(s, MSG_MAGIC"X", MSG_MAGIC_LEN) == 0)
// Start after MSG_MAGIC so it won't appear in the object file either.
#define MSG_HAS_BUTTONID(s) \