diff options
author | Monty Brandenberg <monty@lindenlab.com> | 2013-04-29 17:09:13 -0400 |
---|---|---|
committer | Monty Brandenberg <monty@lindenlab.com> | 2013-04-29 17:09:13 -0400 |
commit | f9850aa5d2fbed3e039ac1a1015ff73065664f17 (patch) | |
tree | e318b7e5eeeb7c1ef73d03803ae4ce55885f2e7c /indra/llcorehttp/_httpoprequest.cpp | |
parent | b49f6e1e744e7650fbea77e5744343d223e962a3 (diff) |
BUG-2295/MAINT-2624 [FIXED] Crash in HttpOpRequest::stageFromActive w/ Content-Range
Don't rely on a response body being present should a
Content-Range header be parsed. Unit tests captured
the original crash and confirm the fix.
Diffstat (limited to 'indra/llcorehttp/_httpoprequest.cpp')
-rw-r--r-- | indra/llcorehttp/_httpoprequest.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index 89dcd334f4..12eed06b10 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -4,7 +4,7 @@ * * $LicenseInfo:firstyear=2012&license=viewerlgpl$ * Second Life Viewer Source Code - * Copyright (C) 2012, Linden Research, Inc. + * Copyright (C) 2012-2013, Linden Research, Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public @@ -186,9 +186,11 @@ void HttpOpRequest::stageFromActive(HttpService * service) if (mReplyLength) { // If non-zero, we received and processed a Content-Range - // header with the response. Verify that what it says - // is consistent with the received data. - if (mReplyLength != mReplyBody->size()) + // header with the response. If there is received data + // (and there may not be due to protocol violations, + // HEAD requests, etc., see BUG-2295) Verify that what it + // says is consistent with the received data. + if (mReplyBody && mReplyBody->size() && mReplyLength != mReplyBody->size()) { // Not as expected, fail the request mStatus = HttpStatus(HttpStatus::LLCORE, HE_INV_CONTENT_RANGE_HDR); |