Skip to content
Snippets Groups Projects
Commit da72f6c5 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Fix possible NULL dereference

Caught by scan-build.
Not actually possible with any of the current backends, but the API
would allow it to happen.
parent c6475fae
No related branches found
No related tags found
No related merge requests found
......@@ -1285,6 +1285,8 @@ CIOLIBEXPORT int ciolib_gettext(int a,int b,int c,int d,void *e)
CIOLIB_INIT();
if (cio_api.gettext == NULL) {
if (cio_api.vmem_gettext == NULL)
return 0;
buf = malloc((c-a+1)*(d-b+1)*sizeof(*buf));
if (buf == NULL)
return 0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment