Merge pull request #1437 from craiglink/memory-overrun

set array size correctly to 4
This commit is contained in:
Marek Běl 2019-05-11 03:01:52 +02:00 committed by GitHub
commit bbd1b60229
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -229,7 +229,7 @@ inline bool parse_version_P(const char *str, uint16_t version[4])
// 1 - yes, 0 - false, -1 - error; // 1 - yes, 0 - false, -1 - error;
inline int8_t is_provided_version_newer(const char *version_string) inline int8_t is_provided_version_newer(const char *version_string)
{ {
uint16_t ver_gcode[3], ver_current[3]; uint16_t ver_gcode[4], ver_current[4];
if (! parse_version(version_string, ver_gcode)) if (! parse_version(version_string, ver_gcode))
return -1; return -1;
if (! parse_version_P(FW_VERSION_STR, ver_current)) if (! parse_version_P(FW_VERSION_STR, ver_current))