When calculating the hash for filename in _cairo_ft_unscaled_font_init_key there is a missing check for a NULL filename.[line 260 in cairo-ft-font.c] A workaround for a NULL filename could be if (filename!=NULL) { hash = _cairo_hash_string (filename); } else { snprintf(tmp,12,"cairoXXXXXX"); mkstemp(tmp); hash = _cairo_hash_string (tmp); }
Created attachment 2898 [details] [review] Proposed patch for cairo-ft-font.c
Note the attached patch is wrong as it uses mkstemp and not mktemp. Also the use of mktemp needs to be checked for NULL returns. Another method would be to generate a random number when filename==NULL;
We don't need to hash NULL strings uniquely. But the more fundamental issue is that we never need to do any hashing at all when the filename is NULL. *** This bug has been marked as a duplicate of 4110 ***
Move bugs against "cvs" version to "0.9.3" so we can remove the "cvs" version.
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.