File: 51-htcp-assert.dpatch

package info (click to toggle)
squid 2.6.5-6etch5
  • links: PTS
  • area: main
  • in suites: etch
  • size: 12,540 kB
  • ctags: 13,801
  • sloc: ansic: 105,278; sh: 6,083; makefile: 1,297; perl: 1,245; awk: 40
file content (28 lines) | stat: -rw-r--r-- 844 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#! /bin/sh /usr/share/dpatch/dpatch-run
## 51-htcp-assert.dpatch by Luigi Gangitano <luigi@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.

@DPATCH@
diff -urNad squid-2.6.5~/src/htcp.c squid-2.6.5/src/htcp.c
--- squid-2.6.5~/src/htcp.c	2006-07-29 19:35:31.000000000 +0200
+++ squid-2.6.5/src/htcp.c	2006-11-06 11:40:22.000000000 +0100
@@ -1,6 +1,6 @@
 
 /*
- * $Id: htcp.c,v 1.53 2006/07/29 17:35:31 serassio Exp $
+ * $Id: htcp.c,v 1.54 2006/11/04 14:14:07 hno Exp $
  *
  * DEBUG: section 31    Hypertext Caching Protocol
  * AUTHOR: Duane Wesssels
@@ -242,7 +242,8 @@
     assert(2 == sizeof(u_short));
     auth.length = htons(2);
     copy_sz += 2;
-    assert(buflen >= copy_sz);
+    if (buflen < copy_sz)
+	return -1;
     xmemcpy(buf, &auth, copy_sz);
     return copy_sz;
 }