libretro / daphne

14 stars 16 forks source link

Add check against null? #37

Open QiAnXinCodeSafe opened 5 years ago

QiAnXinCodeSafe commented 5 years ago

Hi all, There is a possible null pointer dereference issue found by Qihoo360 CodeSafe Team. Details as bellow:

the return value of function FontPointer() may be a null pointer if there's an error. https://github.com/libretro/daphne/blob/0258e2d7fbcc02e07379a19fa6a12e792e442c83/daphne/daphne-1.0-src/video/SDL_DrawText.cpp#L74-L77

after calling this function, there is no check for error nor check the return pointer against null. https://github.com/libretro/daphne/blob/0258e2d7fbcc02e07379a19fa6a12e792e442c83/daphne/daphne-1.0-src/video/SDL_DrawText.cpp#L104-L109

Cheers Qihoo360 CodeSafe Team