From c743c30cb98998de80931e33b52d5fc8ad5190c8 Mon Sep 17 00:00:00 2001 From: Peter Howkins Date: Tue, 3 Jul 2018 18:39:32 +0100 Subject: [PATCH] dtstyle: Coverity 87763 --- cde/programs/dtstyle/ColorFile.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cde/programs/dtstyle/ColorFile.c b/cde/programs/dtstyle/ColorFile.c index fe44ca5b..5c87e8cf 100644 --- a/cde/programs/dtstyle/ColorFile.c +++ b/cde/programs/dtstyle/ColorFile.c @@ -248,7 +248,9 @@ ReadPalette( /* load the filename into the name element */ p = strstr (in_filename, PALETTE_SUFFIX); - *p = '\0'; + if(p) { + *p = '\0'; + } strcpy(new_palette->name, in_filename); /* -- 2.25.1