From dd5890993b0b4e4685202dd4ef10384db8c10262 Mon Sep 17 00:00:00 2001 From: Michael R Sweet Date: Thu, 12 Oct 2023 10:45:56 -0400 Subject: [PATCH] Fix device list crash (Issue #296) --- CHANGES.md | 1 + pappl/device.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 58fbe655..d03e041c 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ Changes in PAPPL Changes in v1.4.2 ----------------- +- Fixed potential crash while listing devices (Issue #296) - Fixed potential deadlock issue (Issue #297) diff --git a/pappl/device.c b/pappl/device.c index 9d3b4064..b3ddbeae 100644 --- a/pappl/device.c +++ b/pappl/device.c @@ -577,7 +577,7 @@ _papplDeviceInfoCallback( // Make copies of the strings... d->device_info = strdup(device_info); d->device_uri = strdup(device_uri); - d->device_id = strdup(device_id); + d->device_id = strdup(device_id ? device_id : ""); if (d->device_info && d->device_uri && d->device_id) {