Guard string assignment
Visual Studio 2005 fired an assert on the negative self tests because the SecByteBlock was 0-sized and returned a null pointer.pull/398/head
parent
e7fa88083c
commit
0c6510b0a5
5
asn.cpp
5
asn.cpp
|
|
@ -171,7 +171,10 @@ size_t BERDecodeTextString(BufferedTransformation &bt, std::string &str, byte as
|
||||||
SecByteBlock temp(bc);
|
SecByteBlock temp(bc);
|
||||||
if (bc != bt.Get(temp, bc))
|
if (bc != bt.Get(temp, bc))
|
||||||
BERDecodeError();
|
BERDecodeError();
|
||||||
str.assign((char *)temp.begin(), bc);
|
if (bc)
|
||||||
|
str.assign((char *)temp.begin(), bc);
|
||||||
|
else
|
||||||
|
str.clear();
|
||||||
return bc;
|
return bc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue