tools/tiff2pdf.c:4350: error: Null Dereference
  pointer `currenttime` last assigned on line 4347 could be null and is dereferenced at line 4350, column 4.

tools/tiff2pdf.c:4336:1: start of procedure t2p_pdf_currenttime()
4334.  */
4335. 
4336. void t2p_pdf_currenttime(T2P* t2p)
      ^
4337. {
4338. 	struct tm* currenttime;

tools/tiff2pdf.c:4341:6: Taking true branch
4339. 	time_t timenow;
4340. 
4341. 	if (time(&timenow) == (time_t) -1) {
           ^
4342. 		TIFFError(TIFF2PDF_MODULE,
4343. 			  "Can't get the current time: %s", strerror(errno));

tools/tiff2pdf.c:4342:3: Skipping strerror(): method has no implementation
4340. 
4341. 	if (time(&timenow) == (time_t) -1) {
4342. 		TIFFError(TIFF2PDF_MODULE,
        ^
4343. 			  "Can't get the current time: %s", strerror(errno));
4344. 		timenow = (time_t) 0;

libtiff/tif_error.c:48:1: start of procedure TIFFError()
  46. }
  47. 
  48. void
      ^
  49. TIFFError(const char* module, const char* fmt, ...)
  50. {

libtiff/tif_error.c:52:6: Taking true branch
  50. {
  51. 	va_list ap;
  52. 	if (_TIFFerrorHandler) {
           ^
  53. 		va_start(ap, fmt);	
  54. 		(*_TIFFerrorHandler)(module, fmt, ap);

libtiff/tif_error.c:53:3: 
  51. 	va_list ap;
  52. 	if (_TIFFerrorHandler) {
  53. 		va_start(ap, fmt);	
        ^
  54. 		(*_TIFFerrorHandler)(module, fmt, ap);
  55. 		va_end(ap);

libtiff/tif_error.c:54:3: Skipping __function_pointer__(): unresolved function pointer
  52. 	if (_TIFFerrorHandler) {
  53. 		va_start(ap, fmt);	
  54. 		(*_TIFFerrorHandler)(module, fmt, ap);
        ^
  55. 		va_end(ap);
  56. 	}

libtiff/tif_error.c:55:3: 
  53. 		va_start(ap, fmt);	
  54. 		(*_TIFFerrorHandler)(module, fmt, ap);
  55. 		va_end(ap);
        ^
  56. 	}
  57. 	if (_TIFFerrorHandlerExt) {

libtiff/tif_error.c:57:6: Taking true branch
  55. 		va_end(ap);
  56. 	}
  57. 	if (_TIFFerrorHandlerExt) {
           ^
  58. 		va_start(ap, fmt);
  59. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);

libtiff/tif_error.c:58:3: 
  56. 	}
  57. 	if (_TIFFerrorHandlerExt) {
  58. 		va_start(ap, fmt);
        ^
  59. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);
  60. 		va_end(ap);

libtiff/tif_error.c:59:3: Skipping __function_pointer__(): unresolved function pointer
  57. 	if (_TIFFerrorHandlerExt) {
  58. 		va_start(ap, fmt);
  59. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);
        ^
  60. 		va_end(ap);
  61. 	}

libtiff/tif_error.c:60:3: 
  58. 		va_start(ap, fmt);
  59. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);
  60. 		va_end(ap);
        ^
  61. 	}
  62. }

libtiff/tif_error.c:57:2: 
  55. 		va_end(ap);
  56. 	}
  57. 	if (_TIFFerrorHandlerExt) {
       ^
  58. 		va_start(ap, fmt);
  59. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);

libtiff/tif_error.c:62:1: return from a call to TIFFError
  60. 		va_end(ap);
  61. 	}
  62. }
      ^
  63. 
  64. void

tools/tiff2pdf.c:4344:3: 
4342. 		TIFFError(TIFF2PDF_MODULE,
4343. 			  "Can't get the current time: %s", strerror(errno));
4344. 		timenow = (time_t) 0;
        ^
4345. 	}
4346. 

tools/tiff2pdf.c:4347:2: 
4345. 	}
4346. 
4347. 	currenttime = localtime(&timenow);
       ^
4348. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4349. 		 "D:%.4u%.2u%.2u%.2u%.2u%.2u",

tools/tiff2pdf.c:4350:4: 
4348. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4349. 		 "D:%.4u%.2u%.2u%.2u%.2u%.2u",
4350. 		 TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
         ^
4351. 		 TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),   /* 0-11 + 1 */
4352. 		 TIFFmin((unsigned) currenttime->tm_mday,31U),       /* 1-31 */

void t2p_pdf_currenttime(T2P* t2p)
{
	struct tm* currenttime;
	time_t timenow;
	if (time(&timenow) == (time_t) -1) {
		TIFFError(TIFF2PDF_MODULE,
			  "Can't get the current time: %s", strerror(errno));
		timenow = (time_t) 0;
	}
	currenttime = localtime(&timenow);
	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
		 "D:%.4u%.2u%.2u%.2u%.2u%.2u",
		 TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),
		 TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),
		 TIFFmin((unsigned) currenttime->tm_mday,31U),
		 TIFFmin((unsigned) currenttime->tm_hour,23U),
		 TIFFmin((unsigned) currenttime->tm_min,59U),
		 TIFFmin((unsigned) (currenttime->tm_sec),60U));
	return;
}
['void t2p_pdf_currenttime(T2P* t2p)\n{\n\tstruct tm* currenttime;\n\ttime_t timenow;\n\tif (time(&timenow) == (time_t) -1) {\n\t\tTIFFError(TIFF2PDF_MODULE,\n\t\t\t  "Can\'t get the current time: %s", strerror(errno));\n\t\ttimenow = (time_t) 0;\n\t}\n\tcurrenttime = localtime(&timenow);\n\tsnprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),\n\t\t "D:%.4u%.2u%.2u%.2u%.2u%.2u",\n\t\t TIFFmin((unsigned) currenttime->tm_year + 1900U,9999U),\n\t\t TIFFmin((unsigned) currenttime->tm_mon + 1U,12U),\n\t\t TIFFmin((unsigned) currenttime->tm_mday,31U),\n\t\t TIFFmin((unsigned) currenttime->tm_hour,23U),\n\t\t TIFFmin((unsigned) currenttime->tm_min,59U),\n\t\t TIFFmin((unsigned) (currenttime->tm_sec),60U));\n\treturn;\n}', 'void\nTIFFError(const char* module, const char* fmt, ...)\n{\n\tva_list ap;\n\tif (_TIFFerrorHandler) {\n\t\tva_start(ap, fmt);\n\t\t(*_TIFFerrorHandler)(module, fmt, ap);\n\t\tva_end(ap);\n\t}\n\tif (_TIFFerrorHandlerExt) {\n\t\tva_start(ap, fmt);\n\t\t(*_TIFFerrorHandlerExt)(0, module, fmt, ap);\n\t\tva_end(ap);\n\t}\n}']