summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'net-print/cups/files/cups-1.1.20-zero-len-udp-dos.patch')
-rw-r--r--net-print/cups/files/cups-1.1.20-zero-len-udp-dos.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/net-print/cups/files/cups-1.1.20-zero-len-udp-dos.patch b/net-print/cups/files/cups-1.1.20-zero-len-udp-dos.patch
new file mode 100644
index 000000000000..04ab3f2e08e4
--- /dev/null
+++ b/net-print/cups/files/cups-1.1.20-zero-len-udp-dos.patch
@@ -0,0 +1,22 @@
+--- cupsys-1.1.20final+rc1/scheduler/dirsvc.c.OLD 2004-05-27 11:04:32.000000000 -0700
++++ cupsys-1.1.20final+rc1/scheduler/dirsvc.c 2004-08-20 19:20:08.000000000 -0700
+@@ -1093,7 +1093,7 @@
+ int auth; /* Authorization status */
+ int len; /* Length of name string */
+ int bytes; /* Number of bytes left */
+- char packet[1540], /* Broadcast packet */
++ char packet[1541], /* Broadcast packet */
+ *pptr; /* Pointer into packet */
+ struct sockaddr_in srcaddr; /* Source address */
+ char srcname[1024]; /* Source hostname */
+@@ -1118,8 +1118,8 @@
+ */
+
+ len = sizeof(srcaddr);
+- if ((bytes = recvfrom(BrowseSocket, packet, sizeof(packet), 0,
+- (struct sockaddr *)&srcaddr, &len)) <= 0)
++ if ((bytes = recvfrom(BrowseSocket, packet, sizeof(packet)-1, 0,
++ (struct sockaddr *)&srcaddr, &len)) < 0)
+ {
+ /*
+ * "Connection refused" is returned under Linux if the destination port