summaryrefslogtreecommitdiff
path: root/src/common/torgzip.c
diff options
context:
space:
mode:
authorNick Mathewson <nickm@torproject.org>2011-05-11 16:23:42 -0400
committerNick Mathewson <nickm@torproject.org>2011-05-11 16:24:29 -0400
commit44ad73457303ed0bf80f6c4c645a62e03b42149b (patch)
treea7aeb75625c0643b7c2434dc4c57beecd87e8826 /src/common/torgzip.c
parent7206d784dc3def970d5bd8618242f7b9c9c71e37 (diff)
parent59f9097d5c3dc010847c359888d31757d1c97904 (diff)
downloadtor-44ad73457303ed0bf80f6c4c645a62e03b42149b.tar.gz
tor-44ad73457303ed0bf80f6c4c645a62e03b42149b.zip
Merge remote-tracking branch 'public/3122_memcmp_squashed' into bug3122_memcmp_022
Conflicts throughout. All resolved in favor of taking HEAD and adding tor_mem* or fast_mem* ops as appropriate. src/common/Makefile.am src/or/circuitbuild.c src/or/directory.c src/or/dirserv.c src/or/dirvote.c src/or/networkstatus.c src/or/rendclient.c src/or/rendservice.c src/or/router.c src/or/routerlist.c src/or/routerparse.c src/or/test.c
Diffstat (limited to 'src/common/torgzip.c')
-rw-r--r--src/common/torgzip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/common/torgzip.c b/src/common/torgzip.c
index e9079e0ba5..2937c67de2 100644
--- a/src/common/torgzip.c
+++ b/src/common/torgzip.c
@@ -378,7 +378,7 @@ tor_gzip_uncompress(char **out, size_t *out_len,
compress_method_t
detect_compression_method(const char *in, size_t in_len)
{
- if (in_len > 2 && !memcmp(in, "\x1f\x8b", 2)) {
+ if (in_len > 2 && fast_memeq(in, "\x1f\x8b", 2)) {
return GZIP_METHOD;
} else if (in_len > 2 && (in[0] & 0x0f) == 8 &&
(ntohs(get_uint16(in)) % 31) == 0) {