Browse Source

Prevent out of bounds array access

pull/1898/head
Vort 2 years ago
parent
commit
a4759694c8
  1. 2
      libi2pd/Reseed.cpp

2
libi2pd/Reseed.cpp

@ -320,7 +320,7 @@ namespace data
uint16_t fileNameLength, extraFieldLength; uint16_t fileNameLength, extraFieldLength;
s.read ((char *)&fileNameLength, 2); s.read ((char *)&fileNameLength, 2);
fileNameLength = le16toh (fileNameLength); fileNameLength = le16toh (fileNameLength);
if ( fileNameLength > 255 ) { if ( fileNameLength >= 255 ) {
// too big // too big
LogPrint(eLogError, "Reseed: SU3 fileNameLength too large: ", fileNameLength); LogPrint(eLogError, "Reseed: SU3 fileNameLength too large: ", fileNameLength);
return numFiles; return numFiles;

Loading…
Cancel
Save