mirror of
https://github.com/tumic0/GPXSee.git
synced 2025-01-19 04:02:09 +01:00
Fixed possible invalid memory access
This commit is contained in:
parent
2bdab0f449
commit
1242423ca8
@ -7,10 +7,10 @@ static bool validSentence(const char *line, int len)
|
|||||||
{
|
{
|
||||||
const char *lp;
|
const char *lp;
|
||||||
|
|
||||||
if (len < 10 || line[0] != '$')
|
if (len < 12 || line[0] != '$')
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
for (lp = line + len - 1; lp > line; lp--)
|
for (lp = line + len - 1; lp > line + 3; lp--)
|
||||||
if (!::isspace(*lp))
|
if (!::isspace(*lp))
|
||||||
break;
|
break;
|
||||||
if (*(lp-2) != '*' || !::isalnum(*(lp-1)) || !::isalnum(*(lp)))
|
if (*(lp-2) != '*' || !::isalnum(*(lp-1)) || !::isalnum(*(lp)))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user