Fixed 'String too large' error in command-line tool.

This commit is contained in:
Florian Pose 2012-04-10 18:56:50 +02:00
parent 97a7825606
commit d663214c65
1 changed files with 3 additions and 2 deletions

View File

@ -186,9 +186,10 @@ size_t DataTypeHandler::interpretAsType(
case 0x000a: // octet_string
case 0x000b: // unicode_string
dataSize = str.str().size();
if (dataSize >= targetSize) {
if (dataSize > targetSize) {
stringstream err;
err << "String too large";
err << "String too large ("
<< dataSize << " > " << targetSize << ")";
throw SizeException(err.str());
}
str >> (char *) target;