Code Review
/
common
/
thrift.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
review
|
tree
raw
|
patch
| inline |
side by side
(parent:
f50021a
)
Fix potential out of bounds read issue with getTypeIDForTypeName().
author
David Reiss
<dreiss@apache.org>
Sun, 2 Mar 2008 00:20:47 +0000
(
00:20
+0000)
committer
David Reiss
<dreiss@apache.org>
Sun, 2 Mar 2008 00:20:47 +0000
(
00:20
+0000)
Make sure type name is at least 2 characters long.
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665536
13f79535
-47bb-0310-9956-
ffa450edef68
lib/cpp/src/protocol/TJSONProtocol.cpp
patch
|
blob
|
history
diff --git
a/lib/cpp/src/protocol/TJSONProtocol.cpp
b/lib/cpp/src/protocol/TJSONProtocol.cpp
index
39eb129
..
d2d56c1
100644
(file)
--- a/
lib/cpp/src/protocol/TJSONProtocol.cpp
+++ b/
lib/cpp/src/protocol/TJSONProtocol.cpp
@@
-81,7
+81,7
@@
static const std::string &getTypeNameForTypeID(TType typeID) {
static TType getTypeIDForTypeName(const std::string &name) {
TType result = T_STOP; // Sentinel value
- if (name.length() >
0
) {
+ if (name.length() >
1
) {
switch (name[0]) {
case 'd':
result = T_DOUBLE;