Fixed check for member of stroke_msg_t in pop_string.
Because of the cast to char** the length of the message was multiplied by sizeof(char*), i.e. 4 or 8 bytes (depending on the architecture) instead of by 1 (sizeof(char)).
This commit is contained in:
parent
e54a2bd20e
commit
aee071ed8b
|
@ -122,7 +122,7 @@ static void pop_string(stroke_msg_t *msg, char **string)
|
|||
|
||||
/* check for sanity of string pointer and string */
|
||||
if (string < (char**)msg ||
|
||||
string > (char**)msg + sizeof(stroke_msg_t) ||
|
||||
string > (char**)((char*)msg + sizeof(stroke_msg_t)) ||
|
||||
(unsigned long)*string < (unsigned long)((char*)msg->buffer - (char*)msg) ||
|
||||
(unsigned long)*string > msg->length)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue