Select Page

apt-get source driftnet

START COPY BELOW LINE ———https://bugzilla.redhat.com/attachment.cgi?id=134667———

--- driftnet-0.1.6/image.c 2002-07-09 20:26:41.000000000 +0100
+++ driftnet-0.1.6.new/image.c 2006-08-22 21:14:38.000000000 +0100
@@ -15,29 +15,20 @@ static const char rcsid[] = "$Id: image.

/* memstr:
* Locate needle, of length n_len, in haystack, of length h_len, returning NULL.
- * Uses the Boyer-Moore search algorithm. Cf.
- * http://www-igm.univ-mlv.fr/~lecroq/string/node14.html */
-static unsigned char *memstr(const unsigned char *haystack, const size_t hlen,
- const unsigned char *needle, const size_t nlen) {
- int skip[256], k;
-
- if (nlen == 0) return (char*)haystack;
-
- /* Set up the finite state machine we use. */
- for (k = 0; k < 255; ++k) skip[k] = nlen; - for (k = 0; k < nlen - 1; ++k) skip[needle[k]] = nlen - k - 1; - - /* Do the search. */ - for (k = nlen - 1; k < hlen; k += skip[haystack[k]]) { - int i, j; - for (j = nlen - 1, i = k; j >= 0 && haystack[i] == needle[j]; j--) i--;
- if (j == -1) return (unsigned char*)(haystack + i + 1);
- }
-
- return NULL;
+ */
+char *memstr(const unsigned char *haystack, const size_t hlen,
+ const unsigned char *needle, const size_t nlen)
+{
+ char *p;
+
+ for (p = haystack; p <= (haystack - nlen + hlen); p++) + { + if (memcmp(p, needle, nlen) == 0) + return p; /* found */ + } + return NULL; } - /* If we run out of space, put us back to the last candidate GIF header. */ /*#define spaceleft do { if (block > data + len) { printf("ran out of space\n"); return gifhdr; } } while (0)*/
#define spaceleft if (block > data + len) return gifhdr

END COPY ABOVE LINE ——————–

patch < PATCHFILE dpkg-buildpackage -rfakeroot -uc -b ;from within the directory that was created for the package after downloading. dpkg -i PACKAGE.deb driftnet -i eth0 -p -a -d /tmp/test