diff options
author | 2009-11-26 10:35:57 -0500 | |
---|---|---|
committer | 2009-11-26 10:35:57 -0500 | |
commit | 27e785f13b18b42885b15cb38a2cd48d7e8fbdd5 (patch) | |
tree | efb1a62ae46a74a126502251cec49a83b5f80f96 /src/c/fastcgi.c | |
parent | e711704484b43a543a3b5fadd160613d5e869367 (diff) |
Fix parsing of long FastCGI lengths
Diffstat (limited to 'src/c/fastcgi.c')
-rw-r--r-- | src/c/fastcgi.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/c/fastcgi.c b/src/c/fastcgi.c index 7d2ce067..1a8a8316 100644 --- a/src/c/fastcgi.c +++ b/src/c/fastcgi.c @@ -223,7 +223,7 @@ static int read_funny_len(unsigned char **buf, int *len) { else if (*len < 4) return -1; else { - int r = (((*buf)[3] & 0x7f) << 24) + ((*buf)[2] << 16) + ((*buf)[1] << 8) + (*buf)[0]; + int r = (((*buf)[0] & 0x7f) << 24) + ((*buf)[1] << 16) + ((*buf)[2] << 8) + (*buf)[3]; *buf += 4; *len -= 4; return r; @@ -236,9 +236,9 @@ static int read_nvp(unsigned char **buf, int len, nvp *nv) { if ((nameLength = read_funny_len(buf, &len)) < 0) return -1; if ((valueLength = read_funny_len(buf, &len)) < 0) - return -1; + return -2; if (len < nameLength + valueLength) - return -1; + return -3; if (nameLength+1 > nv->name_len) { nv->name_len = nameLength+1; @@ -374,7 +374,7 @@ static void *worker(void *data) { goto done; } - write_stderr(out, "PARAM: %s -> %s\n", hs.nvps[used_nvps].name, hs.nvps[used_nvps].value); + //write_stderr(out, "PARAM: %s -> %s\n", hs.nvps[used_nvps].name, hs.nvps[used_nvps].value); ++used_nvps; } |