aboutsummaryrefslogtreecommitdiff
path: root/cores
diff options
context:
space:
mode:
authorCristian Maglie <c.maglie@bug.st>2013-06-06 20:04:43 +0200
committerCristian Maglie <c.maglie@bug.st>2013-06-06 20:04:43 +0200
commitf25e5e94f7cd529fe57e1cbe94a9aafce94aaddf (patch)
tree738356afafb754bd6bdb8c903d5b06db51e53e05 /cores
parent550b6adcfc4e2dba5678155a883eecdf0840c8e9 (diff)
Fixed buffer overflow on String class (Paul Stoffregen)
Diffstat (limited to 'cores')
-rw-r--r--cores/arduino/WString.cpp4
-rw-r--r--cores/robot/WString.cpp4
2 files changed, 4 insertions, 4 deletions
diff --git a/cores/arduino/WString.cpp b/cores/arduino/WString.cpp
index ace128d..8c85cc5 100644
--- a/cores/arduino/WString.cpp
+++ b/cores/arduino/WString.cpp
@@ -296,14 +296,14 @@ unsigned char String::concat(unsigned char num)
unsigned char String::concat(int num)
{
- char buf[7];
+ char buf[12];
itoa(num, buf, 10);
return concat(buf, strlen(buf));
}
unsigned char String::concat(unsigned int num)
{
- char buf[6];
+ char buf[11];
utoa(num, buf, 10);
return concat(buf, strlen(buf));
}
diff --git a/cores/robot/WString.cpp b/cores/robot/WString.cpp
index ace128d..8c85cc5 100644
--- a/cores/robot/WString.cpp
+++ b/cores/robot/WString.cpp
@@ -296,14 +296,14 @@ unsigned char String::concat(unsigned char num)
unsigned char String::concat(int num)
{
- char buf[7];
+ char buf[12];
itoa(num, buf, 10);
return concat(buf, strlen(buf));
}
unsigned char String::concat(unsigned int num)
{
- char buf[6];
+ char buf[11];
utoa(num, buf, 10);
return concat(buf, strlen(buf));
}