From a326e598067c2ca406456a7f7f7937c6ba0f2368 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 15:02:47 -0500 Subject: [PATCH 1/5] CodeAi generated fix --- tools/tiff2ps.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tools/tiff2ps.c b/tools/tiff2ps.c index 82a5d84..3563f30 100644 --- a/tools/tiff2ps.c +++ b/tools/tiff2ps.c @@ -2964,7 +2964,9 @@ tsize_t Ascii85EncodeBlock( uint8 * ascii85_p, unsigned f_eod, const uint8 * raw if ( val32 == 0 ) /* Special case */ { - ascii85_p[ascii85_l] = 'z'; + if(ascii85_p != NULL) { + ascii85_p[ascii85_l] = 'z'; + } rc = 1; } From 2fb5e317b6e96ac789bef0334b1a737959f64f14 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 15:37:14 -0500 Subject: [PATCH 2/5] CodeAi generated fix --- tools/tiffcrop.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c index 722b132..470a18d 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -958,7 +958,6 @@ static int readContigTilesIntoBuffer (TIFF* in, uint8* buf, return 1; } } - prev_trailing_bits += trailing_bits; /* if (prev_trailing_bits > 7) */ /* prev_trailing_bits-= 8; */ } From f74b212b17cbffa1090802016e2057e429a9b1fb Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 16:46:18 -0500 Subject: [PATCH 3/5] CodeAi generated fix From fd1aa352ea0d52cbd637976b09b542e898bbcd75 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Tue, 9 Jan 2018 16:47:04 -0500 Subject: [PATCH 4/5] CodeAi generated fix From 1873098ed7d2fe11c6aa65a69c754948c7b18705 Mon Sep 17 00:00:00 2001 From: CodeAi Date: Wed, 21 Mar 2018 12:32:00 -0400 Subject: [PATCH 5/5] CodeAi generated fix for CWE 476 Null Pointer Dereference --- tools/tiff2pdf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c index fe8a6ea..b7b4b01 100644 --- a/tools/tiff2pdf.c +++ b/tools/tiff2pdf.c @@ -747,7 +747,7 @@ int main(int argc, char** argv){ /* * Input */ - if(argc > optind) { + if(argv && (argc > optind)) { input = TIFFOpen(argv[optind++], "r"); if (input==NULL) { TIFFError(TIFF2PDF_MODULE,