oizma / angleproject

Automatically exported from code.google.com/p/angleproject
Other
0 stars 0 forks source link

(patch) memleak in float literals parsing #93

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
In r470 (fixing issue 32), we added this code:

double atof_dot(const char *str)
{
#ifdef _MSC_VER
    return _atof_l(str, _create_locale(LC_NUMERIC, "C"));
#else

This creates a locale but forgets to free it. See 
http://msdn.microsoft.com/en-us/library/4zx9aht2.aspx : "The _locale_t 
structure should be freed using _free_locale when it is no longer needed."

There is a DOS risk here: an attacker could repeatedly compile shaders 
containing lots of float literals.

The attached patch fixes it.

Original issue reported on code.google.com by jacob.be...@gmail.com on 11 Dec 2010 at 5:57

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dan...@transgaming.com on 12 Dec 2010 at 6:41

GoogleCodeExporter commented 9 years ago
fixed in r504

Original comment by dan...@transgaming.com on 12 Dec 2010 at 8:56