ecore_imf: Avoid potential buffer overrun

We can't just blindly copy the full string into a 128 byte buffer. Adding
some check here to actually stay below the buffer limit or return.

CID 1193233
This commit is contained in:
Stefan Schmidt 2014-05-16 13:52:26 +02:00
parent ddc09dd04e
commit 6924e3010c
1 changed files with 1 additions and 0 deletions

View File

@ -372,6 +372,7 @@ feed_key_event(Evas *evas, const char *str, Eina_Bool fake)
}
else
{
if (strlen(str) + 1 > 128) return;
strncpy(key_string, str, strlen(str));
evas_event_feed_key_down(evas, key_string, key_string, NULL, NULL, timestamp, NULL);
SCIM_DEBUG_FRONTEND(1) << " evas_event_feed_key_down()...\n";