]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
fix _cupsGet1284Values
authorliuli <liuli@uniontech.com>
Fri, 3 Sep 2021 02:23:18 +0000 (10:23 +0800)
committerGitHub <noreply@github.com>
Fri, 3 Sep 2021 02:23:18 +0000 (10:23 +0800)
when 1284id doesn't end with semicolon,_cupsGet1284Values() cannot get last key and value.
eg.
uos@uos-PC:/usr/lib/cups/backend/snmp 10.10.120.220
network socket://10.10.120.220 "Unknown" "FUJI XEROX ApeosPort-V 4070 v  3. 43.  0 Multifunction System" "MANUFACTURER:FUJI XEROX;MODEL:ApeosPort-V 4070" ""

cups/options.c

index 11814c9af256d8796016e14f1d27659dea7b160f..b95785b84dcde3d0fd51ed3590258564767f5c9d 100644 (file)
@@ -598,12 +598,13 @@ _cupsGet1284Values(
 
     if (!*device_id)
       break;
-
+    
+    memset(value, 0, sizeof(value));
     for (ptr = value; *device_id && *device_id != ';'; device_id ++)
       if (ptr < (value + sizeof(value) - 1))
         *ptr++ = *device_id;
 
-    if (!*device_id)
+    if (!*device_id && strlen(value) == 0)
       break;
 
     while (ptr > value && _cups_isspace(ptr[-1]))