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:
755c815
)
cpp: Eliminate a buffer overflow in the tutorial server
author
David Reiss
<dreiss@apache.org>
Thu, 26 Mar 2009 06:15:26 +0000
(06:15 +0000)
committer
David Reiss
<dreiss@apache.org>
Thu, 26 Mar 2009 06:15:26 +0000
(06:15 +0000)
Negative numbers can have 11 characters :)
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@758529
13f79535
-47bb-0310-9956-
ffa450edef68
tutorial/cpp/CppServer.cpp
patch
|
blob
|
history
diff --git
a/tutorial/cpp/CppServer.cpp
b/tutorial/cpp/CppServer.cpp
index
a2c30d2
..
044e1d9
100644
(file)
--- a/
tutorial/cpp/CppServer.cpp
+++ b/
tutorial/cpp/CppServer.cpp
@@
-69,8
+69,8
@@
class CalculatorHandler : public CalculatorIf {
SharedStruct ss;
ss.key = logid;
- char buffer[1
1
];
- s
printf(buffer
, "%d", val);
+ char buffer[1
2
];
+ s
nprintf(buffer, sizeof(buffer)
, "%d", val);
ss.value = buffer;
log[logid] = ss;