]> git.ipfire.org Git - thirdparty/cups.git/commitdiff
Fix clang-reported issues (<rdar://problem/15936066>)
authormsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 29 Jan 2014 16:29:50 +0000 (16:29 +0000)
committermsweet <msweet@a1ca3aef-8c08-0410-bb20-df032aa958be>
Wed, 29 Jan 2014 16:29:50 +0000 (16:29 +0000)
- httpAddrGetList could leak memory.
- cupsRasterInterpretPPD could access freed memory.

git-svn-id: svn+ssh://src.apple.com/svn/cups/cups.org/trunk@11550 a1ca3aef-8c08-0410-bb20-df032aa958be

CHANGES-1.7.txt
cups/http-addrlist.c
filter/interpret.c

index 2762fc7cde8e7e10d07d9fe4e2d27e6aca787be5..a5084676b1079062219d7053602f1c8c94592965 100644 (file)
@@ -1,6 +1,11 @@
 CHANGES-1.7.txt
 ---------------
 
+CHANGES IN CUPS V1.7.2
+
+       - Fixed some clang-reported issues (<rdar://problem/15936066>)
+
+
 CHANGES IN CUPS V1.7.1
 
        - Security: the lppasswd program incorrectly used settings from
index 287692ff3d6434fd57aab764a8d235f04407eac5..7047f7d111502a8530bcb656201b8080a5692084 100644 (file)
@@ -447,6 +447,7 @@ httpAddrGetList(const char *hostname,       /* I - Hostname, IP address, or NULL for p
 
     if ((first = (http_addrlist_t *)calloc(1, sizeof(http_addrlist_t))) != NULL)
     {
+      addr = first;
       first->addr.un.sun_family = AF_LOCAL;
       strlcpy(first->addr.un.sun_path, hostname, sizeof(first->addr.un.sun_path));
     }
index 1d8323b1f34da2e984fcf7caf147d4abd30dfdd5..307ad37d4f4609783e0ce0788d4875c5d8c6ea90 100644 (file)
@@ -497,6 +497,7 @@ _cupsRasterExecPS(
     int                 *preferred_bits,/* O - Preferred bits per color */
     const char          *code)         /* I - PS code to execute */
 {
+  int                  error = 0;      /* Error condition? */
   _cups_ps_stack_t     *st;            /* PostScript value stack */
   _cups_ps_obj_t       *obj;           /* Object from top of stack */
   char                 *codecopy,      /* Copy of code */
@@ -504,7 +505,7 @@ _cupsRasterExecPS(
 
 
   DEBUG_printf(("_cupsRasterExecPS(h=%p, preferred_bits=%p, code=\"%s\")\n",
-                h, preferred_bits, code ? code : "(null)"));
+                h, preferred_bits, code));
 
  /*
   * Copy the PostScript code and create a stack...
@@ -639,12 +640,13 @@ _cupsRasterExecPS(
 
       case CUPS_PS_OTHER :
           _cupsRasterAddError("Unknown operator \"%s\"!\n", obj->value.other);
+         error = 1;
           DEBUG_printf(("_cupsRasterExecPS: Unknown operator \"%s\"!\n",
                        obj->value.other));
           break;
     }
 
-    if (obj && obj->type == CUPS_PS_OTHER)
+    if (error)
       break;
   }