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:
Tobias Brunner 2011-04-13 18:18:03 +02:00
parent e54a2bd20e
commit aee071ed8b
1 changed files with 1 additions and 1 deletions

View File

@ -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)
{