From 11315e1acce3980bc1022e9287ee92f935f025bf Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Dec 08 2009 11:06:55 +0000 Subject: - Use upstream patch to handle negative SNMP string lengths (rev 8896). --- diff --git a/cups-negative-snmp-string-length.patch b/cups-negative-snmp-string-length.patch new file mode 100644 index 0000000..053f246 --- /dev/null +++ b/cups-negative-snmp-string-length.patch @@ -0,0 +1,19 @@ +diff -up cups-1.4.2/backend/network.c.negative-snmp-string-length cups-1.4.2/backend/network.c +--- cups-1.4.2/backend/network.c.negative-snmp-string-length 2009-08-31 19:45:43.000000000 +0100 ++++ cups-1.4.2/backend/network.c 2009-12-08 11:03:05.728413423 +0000 +@@ -170,9 +170,13 @@ backendNetworkSideCB( + + case CUPS_ASN1_BIT_STRING : + case CUPS_ASN1_OCTET_STRING : +- i = (int)(sizeof(data) - (dataptr - data)); +- if (packet.object_value.string.num_bytes < i) ++ if (packet.object_value.string.num_bytes < 0) ++ i = 0; ++ else if (packet.object_value.string.num_bytes < ++ (sizeof(data) - (dataptr - data))) + i = packet.object_value.string.num_bytes; ++ else ++ i = (int)(sizeof(data) - (dataptr - data)); + + memcpy(dataptr, packet.object_value.string.bytes, i); + diff --git a/cups.spec b/cups.spec index 02924c2..1ee8369 100644 --- a/cups.spec +++ b/cups.spec @@ -62,6 +62,7 @@ Patch37: cups-str3413.patch Patch38: cups-str3439.patch Patch39: cups-str3440.patch Patch40: cups-str3442.patch +Patch41: cups-negative-snmp-string-length.patch Patch100: cups-lspp.patch @@ -231,6 +232,7 @@ module. %patch38 -p1 -b .str3439 %patch39 -p1 -b .str3440 %patch40 -p1 -b .str3442 +%patch41 -p1 -b .negative-snmp-string-length %if %lspp %patch100 -p1 -b .lspp @@ -522,6 +524,7 @@ rm -rf $RPM_BUILD_ROOT %changelog * Tue Dec 8 2009 Tim Waugh - 1:1.4.2-14 +- Use upstream patch to handle negative SNMP string lengths (rev 8896). - Use upstream fix for SNMP detection (bug #542857, STR #3413). - Use the text filter for text/css files (bug #545026, STR #3442). - Show conflicting option values in web UI (bug #544326, STR #3440).