Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

XFA: CFX_FontMgrImp::m_Hash2FileAccess vulnerable to hash collsions #141

Open
GoogleCodeExporter opened this issue May 28, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

It appears that in both CFX_FontMgrImp::LoadFont()s, either a name 
    bsHash += CFX_WideString(pszFileName).UTF8Encode(); 
or a pointer
    FX_LPVOID Hash[1] = {(FX_LPVOID)(FX_UINTPTR)pFontStream};
    FX_DWORD dwHash = FX_HashCode_String_GetA((FX_LPCSTR)Hash, 1 * sizeof (FX_LPVOID));

is reduced to a key, and then used to index into a map without further 
validation upon return that the item corresponded to the original key.
Furthermore it appears to be storing only one item per key, so that a collision 
loses items, etc.

Undoubtedly the right thing to to is to replace the table with an appropriate 
STL container thus avoiding botches in custom-written containers.

Original issue reported on code.google.com by [email protected] on 21 Apr 2015 at 4:43

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant