From: Fabian Keil Date: Mon, 1 Jun 2009 15:33:33 +0000 (+0000) Subject: In decompress_iob(), remove the skip_bytes history lesson and remove an unnecessary... X-Git-Tag: v_3_0_13~54 X-Git-Url: http://www.privoxy.org/gitweb/telemarketing.html?a=commitdiff_plain;h=8cdf45dfe8ce13cc8f0f5e20af73efd5fb5c0a3a;p=privoxy.git In decompress_iob(), remove the skip_bytes history lesson and remove an unnecessary and incorrect assert(). --- diff --git a/parsers.c b/parsers.c index f5da86e8..dbaa8098 100644 --- a/parsers.c +++ b/parsers.c @@ -1,4 +1,4 @@ -const char parsers_rcs[] = "$Id: parsers.c,v 1.169 2009/06/01 14:18:49 fabiankeil Exp $"; +const char parsers_rcs[] = "$Id: parsers.c,v 1.170 2009/06/01 15:14:40 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/parsers.c,v $ @@ -451,30 +451,13 @@ jb_err decompress_iob(struct client_state *csp) /* * Skip a given number of bytes, specified * as a 16-bit little-endian value. - */ - /* - * XXX: This code used to be: - * - * csp->iob->cur += *csp->iob->cur++ + (*csp->iob->cur++ << 8); - * - * which I had to change into: * - * cur += *cur++ + (*cur++ << 8); - * - * at which point gcc43 finally noticed that the value - * of cur is undefined (it depends on which of the - * summands is evaluated first). - * - * I haven't come across a site where this - * code is actually executed yet, but I hope - * it works anyway. + * XXX: this code is untested and should probably be removed. */ int skip_bytes; skip_bytes = *cur++; skip_bytes += *cur++ << 8; - assert(skip_bytes == *csp->iob->cur - 2 + ((*csp->iob->cur - 1) << 8)); - /* * The number of bytes to skip should be positive * and we'd like to stay in the buffer.