From 674c985a0e8752a60b805b46052a71f0295bfd9d Mon Sep 17 00:00:00 2001 From: Daniel Date: Sat, 28 Sep 2024 15:02:45 -0400 Subject: [PATCH] Check NULL --- src/lib.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/lib.c b/src/lib.c index 3089623..37bcc86 100644 --- a/src/lib.c +++ b/src/lib.c @@ -60,6 +60,7 @@ struct PtpRuntime *ptp_new(int options) { } void ptp_set_prop_avail_info(struct PtpRuntime *r, int code, int memb_size, int cnt, void *data) { + if (r->avail == NULL) abort(); // Traverse backwards to first item struct PtpPropAvail *n; for (n = r->avail; n != NULL; n = n->prev) {