From 3881dc717540cd9c29ef0164e9ad2f973c3b11d6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 22 Nov 2023 09:08:30 +1000 Subject: [PATCH] libwacom: only memcmp the led data if we have leds ../libwacom/libwacom.c:498:13: runtime error: null pointer passed as argument 1, which is declared to never be null /usr/include/string.h:65:33: note: nonnull attribute specified here --- libwacom/libwacom.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libwacom/libwacom.c b/libwacom/libwacom.c index 92155994c..d220d149c 100644 --- a/libwacom/libwacom.c +++ b/libwacom/libwacom.c @@ -495,7 +495,8 @@ libwacom_compare(const WacomDevice *a, const WacomDevice *b, WacomCompareFlags f if (a->status_leds->len != b->status_leds->len) return 1; - if (memcmp(a->status_leds->data, b->status_leds->data, + if (a->status_leds->len > 0 && + memcmp(a->status_leds->data, b->status_leds->data, sizeof(WacomStatusLEDs) * a->status_leds->len) != 0) return 1;