[prev in list] [next in list] [prev in thread] [next in thread] 

List:       cups-commit
Subject:    [cups.commit] [CUPS] r10017 - in branches/branch-1.5: backend cups
From:       cups-dev () easysw ! com
Date:       2011-09-26 18:46:46
Message-ID: 10788-cups.commit () news ! easysw ! com
[Download RAW message or body]

Author: mike
Date: 2011-09-26 11:46:46 -0700 (Mon, 26 Sep 2011)
New Revision: 10017
Log:
Mirror fix from trunk.


Modified:
   branches/branch-1.5/backend/dnssd.c
   branches/branch-1.5/cups/http-support.c

Modified: branches/branch-1.5/backend/dnssd.c
===================================================================
--- branches/branch-1.5/backend/dnssd.c	2011-09-26 18:46:36 UTC (rev 10016)
+++ branches/branch-1.5/backend/dnssd.c	2011-09-26 18:46:46 UTC (rev 10017)
@@ -774,7 +774,7 @@
 
         datalen = *data++;
 
-        if (!datalen || (data + datalen) >= dataend)
+        if (!datalen || (data + datalen) > dataend)
 	  break;
 
         datanext = data + datalen;

Modified: branches/branch-1.5/cups/http-support.c
===================================================================
--- branches/branch-1.5/cups/http-support.c	2011-09-26 18:46:36 UTC (rev 10016)
+++ branches/branch-1.5/cups/http-support.c	2011-09-26 18:46:46 UTC (rev 10017)
@@ -1824,16 +1824,35 @@
   if ((value = TXTRecordGetValuePtr(txtLen, txtRecord, "rp",
                                     &valueLen)) != NULL)
   {
+    if (((char *)value)[0] == '/')
+    {
+     /*
+      * "rp" value (incorrectly) has a leading slash already...
+      */
+
+      memcpy(rp, value, valueLen);
+      rp[valueLen] = '\0';
+    }
+    else
+    {
+     /*
+      * Convert to resource by concatenating with a leading "/"...
+      */
+
+      rp[0] = '/';
+      memcpy(rp + 1, value, valueLen);
+      rp[valueLen + 1] = '\0';
+    }
+  }
+  else
+  {
    /*
-    * Convert to resource by concatenating with a leading "/"...
+    * Default "rp" value is blank, mapping to a path of "/"...
     */
 
     rp[0] = '/';
-    memcpy(rp + 1, value, valueLen);
-    rp[valueLen + 1] = '\0';
+    rp[1] = '\0';
   }
-  else
-    rp[0] = '\0';
 
  /*
   * Lookup the FQDN if needed...

_______________________________________________
cups-commit mailing list
cups-commit@easysw.com
http://lists.easysw.com/mailman/listinfo/cups-commit
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic