Skip to content

Commit

Permalink
Buffer underflow sanity check.
Browse files Browse the repository at this point in the history
  • Loading branch information
icculus committed Jan 8, 2010
1 parent dc6278f commit 50d24ad
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions windows_wminput.c
Expand Up @@ -442,6 +442,9 @@ static void get_device_product_name(char *name, size_t namesize,
return;

/* ct == is chars, not bytes, but we used the ASCII version. */
if (ct < 4)
return;

buf = (char *) alloca(ct+1);
keyname = (char *) alloca(ct + sizeof (regkeyroot));
if ((buf == NULL) || (keyname == NULL))
Expand Down

0 comments on commit 50d24ad

Please sign in to comment.