From: Jon Trulson Date: Tue, 3 Apr 2018 00:23:22 +0000 (-0600) Subject: dtudcfonted/gpftobdf.c: Coverity CID 175168; NULL deref X-Git-Tag: 2.2.4a~132^2~4 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=ba95bbc073e549e5e0164c8b9f7e7e3f76112cac;p=oweals%2Fcde.git dtudcfonted/gpftobdf.c: Coverity CID 175168; NULL deref --- diff --git a/cde/programs/dtudcfonted/dtgpftobdf/gpftobdf.c b/cde/programs/dtudcfonted/dtgpftobdf/gpftobdf.c index 565f30a6..5bea3380 100644 --- a/cde/programs/dtudcfonted/dtgpftobdf/gpftobdf.c +++ b/cde/programs/dtudcfonted/dtgpftobdf/gpftobdf.c @@ -1466,9 +1466,19 @@ int fix ; bitmap = pcf->bitmaps + getINT32( (unsigned char *)(pcf->offsets + encodingOffset), pcf->bmp_fmt); - invertBits( bitmap + bmp_adj, pcf->bmp_fmt, ptn_width, cpy_height, bmp_ptn + ptn_adj); - putPtn( (unsigned char *)bmp_ptn, ptn_width, ptn_height ); - fprintf(stdout,"ENDCHAR\n"); + /* Only do this if non-NULL... */ + if (bmp_ptn) + { + invertBits( bitmap + bmp_adj, pcf->bmp_fmt, + ptn_width, cpy_height, bmp_ptn + ptn_adj); + putPtn( (unsigned char *)bmp_ptn, ptn_width, ptn_height ); + } + else + { + fprintf(stderr, "%s: bmp_ptn is NULL", __FUNCTION__); + } + + fprintf(stdout,"ENDCHAR\n"); if( fix == FALSE ) free(bmp_ptn); } if( fix == TRUE ) free(bmp_ptn);