From 0e6161312ca60c6bb5930454202857a89b8fc5aa Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Fri, 12 Apr 2019 16:50:27 +1000 Subject: [PATCH] vulkaninfo: handle html output file open failure. Vulkan-Tools-sdk-1.1.101.0/vulkaninfo/vulkaninfo.c:5008: dereference: Dereferencing a pointer that might be "NULL" "out" when calling "PrintHtmlHeader". Pointed out by coverity. --- vulkaninfo/vulkaninfo.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/vulkaninfo/vulkaninfo.c b/vulkaninfo/vulkaninfo.c index d8961a1..0fec633 100644 --- a/vulkaninfo/vulkaninfo.c +++ b/vulkaninfo/vulkaninfo.c @@ -5500,6 +5500,10 @@ int main(int argc, char **argv) { if (html_output) { out = fopen("vulkaninfo.html", "w"); + if (!out) { + printf("Unable to open vulkaninfo.html for writing\n"); + return 1; + } PrintHtmlHeader(out); fprintf(out, "\t\t\t
"); } else if (human_readable_output) { -- 2.7.4