[MOD] STR #4284: ipp backend crash in backendSNMPSupplies()

Jiri Popelka <[email protected]> Mon, 25 Feb 2013 10:17:27 -0800 (PST)
Newsgroups gmane.comp.printing.cups.bugs
Message-ID <[email protected]>

--PART-BOUNDARY
Content-Type: text/plain

DO NOT REPLY TO THIS MESSAGE.  INSTEAD, POST ANY RESPONSES TO THE LINK BELOW.

[STR New]

Hi,

there's a backtrace [1] in downstream bug [2].
It shows that ipp backed called backendSNMPSupplies() with printer address
(http_addr_t *addr) being NULL.
There's no error log or any other response from original user - probably
meaning that he hasn't been able to reproduce the crash.

I'm attaching sanity check patch, which avoids the traceback. That's all
I've been able to put together without any error_log.

[1] https://bugzilla.redhat.com/attachment.cgi?id=692637
[2] https://bugzilla.redhat.com/show_bug.cgi?id=907358

Link: https://www.cups.org/str.php?L4284
Version: 1.5.4
--PART-BOUNDARY
Content-Type: text/plain
Content-Disposition: attachment;
	filename="0001-backendSNMPSupplies-assert-addr-is-not-NULL.patch"

>From 6d2f158f42f12dcc21e303fa3735320b5164ffca Mon Sep 17 00:00:00 2001
From: Jiri Popelka <[email protected]>
Date: Mon, 4 Feb 2013 17:38:04 +0100
Subject: [PATCH] backendSNMPSupplies(): assert addr is not NULL

RHBZ#907358
---
 backend/snmp-supplies.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/backend/snmp-supplies.c b/backend/snmp-supplies.c
index c669b5d..ddfc7d9 100644
--- a/backend/snmp-supplies.c
+++ b/backend/snmp-supplies.c
@@ -219,7 +219,10 @@ backendSNMPSupplies(
     int         *printer_state)		/* O - Printer state */
 {
   if (!httpAddrEqual(addr, &current_addr))
-    backend_init_supplies(snmp_fd, addr);
+    if (!addr)
+      return (-1);
+    else
+      backend_init_supplies(snmp_fd, addr);
   else if (num_supplies > 0)
     _cupsSNMPWalk(snmp_fd, &current_addr, CUPS_SNMP_VERSION_1,
 		  _cupsSNMPDefaultCommunity(), prtMarkerSuppliesLevel,
-- 
1.8.1


--PART-BOUNDARY
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
cups-bugs mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/cups-bugs

--PART-BOUNDARY--