1
#! /bin/sh /usr/share/dpatch/dpatch-run
2
## 11_security_lighttpd-1.4.x_etags.dpatch.dpatch by Jamie Strandboge <jamie@ubuntu.com>
4
## All lines beginning with `## DP:' are a description of the patch.
5
## DP: etags dereference NULL pointer fix
9
diff -Nru lighttpd-1.4.13.orig/src/buffer.c lighttpd-1.4.13/src/buffer.c
10
--- lighttpd-1.4.13.orig/src/buffer.c 2006-10-04 09:29:17.000000000 -0400
11
+++ lighttpd-1.4.13/src/buffer.c 2007-09-08 15:23:55.000000000 -0400
15
int buffer_is_empty(buffer *b) {
17
return (b->used == 0);
20
diff -Nru lighttpd-1.4.13.orig/src/etag.c lighttpd-1.4.13/src/etag.c
21
--- lighttpd-1.4.13.orig/src/etag.c 2006-10-04 09:29:17.000000000 -0400
22
+++ lighttpd-1.4.13/src/etag.c 2007-09-08 15:23:55.000000000 -0400
26
int etag_is_equal(buffer *etag, const char *matches) {
27
- if (0 == strcmp(etag->ptr, matches)) return 1;
28
+ if (etag && !buffer_is_empty(etag) && 0 == strcmp(etag->ptr, matches)) return 1;