Skip to content

Commit 651f85b

Browse files
author
Federico Fissore
committed
Merge remote-tracking branch 'arduino/ide-1.5.x' into ide-1.5.x
2 parents 553ef6e + be936dd commit 651f85b

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

build/shared/revisions.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
11

2+
ARDUINO 1.5.5 BETA
3+
4+
[libraries]
5+
* avr: Fixed buffer overflow in File::doBuffer() (dreggy)
6+
27
ARDUINO 1.5.4 BETA 2013.09.10
38

49
[ide]

libraries/Bridge/src/FileIO.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -116,10 +116,10 @@ void File::doBuffer() {
116116
if (buffered > 0)
117117
return;
118118

119-
// Try to buffer up to 32 characters
119+
// Try to buffer up to BUFFER_SIZE characters
120120
readPos = 0;
121-
uint8_t cmd[] = {'G', handle, sizeof(buffer)};
122-
buffered = bridge.transfer(cmd, 3, buffer, sizeof(buffer)) - 1;
121+
uint8_t cmd[] = {'G', handle, BUFFER_SIZE - 1};
122+
buffered = bridge.transfer(cmd, 3, buffer, BUFFER_SIZE) - 1;
123123
//err = buff[0]; // First byte is error code
124124
if (buffered>0) {
125125
// Shift the reminder of buffer

0 commit comments

Comments
 (0)