Bug 1145812 - Fix assertion with dom.url.encode_decode_hash pref set to true r=mcmanus

This commit is contained in:
Valentin Gosu 2015-03-23 23:28:50 +02:00
parent 2a723827ca
commit c68e44a847

View File

@ -2514,9 +2514,11 @@ nsStandardURL::SetRef(const nsACString &input)
mRef.mLen = 0;
}
// If precent encoding is necessary, `ref` will point to `buf`'s content.
// `buf` needs to outlive any use of the `ref` pointer.
nsAutoCString buf;
if (nsContentUtils::EncodeDecodeURLHash()) {
// encode ref if necessary
nsAutoCString buf;
bool encoded;
GET_SEGMENT_ENCODER(encoder);
encoder.EncodeSegmentCount(ref, URLSegment(0, refLen), esc_Ref,