vrend: check for NULL in vrend_renderer_get_meminfo

Discovered by the fuzzer.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Ryan Neph <ryanneph@google.com>
macos/master
Chia-I Wu 3 years ago
parent d85bcfbb60
commit 029303e9fd
  1. 4
      src/vrend_renderer.c

@ -11342,6 +11342,10 @@ void vrend_renderer_get_meminfo(struct vrend_context *ctx, uint32_t res_handle)
struct virgl_memory_info *info;
res = vrend_renderer_ctx_res_lookup(ctx, res_handle);
if (!res) {
vrend_report_context_error(ctx, VIRGL_ERROR_CTX_ILLEGAL_RESOURCE, res_handle);
return;
}
info = (struct virgl_memory_info *)res->iov->iov_base;

Loading…
Cancel
Save