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

tools/tiff2pdf.c:4048:1: start of procedure t2p_pdf_currenttime()
4046.  */
4047. 
4048. void t2p_pdf_currenttime(T2P* t2p)
      ^
4049. {
4050. 	struct tm* currenttime;

tools/tiff2pdf.c:4053:6: Taking true branch
4051. 	time_t timenow;
4052. 
4053. 	if (time(&timenow) == (time_t) -1) {
           ^
4054. 		TIFFError(TIFF2PDF_MODULE,
4055. 			  "Can't get the current time: %s", strerror(errno));

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

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

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

libtiff/tif_error.c:55:6: Taking true branch
  53. 	va_list ap;
  54. 	va_start(ap, fmt);
  55. 	if (_TIFFerrorHandler)
           ^
  56. 		(*_TIFFerrorHandler)(module, fmt, ap);
  57. 	if (_TIFFerrorHandlerExt)

libtiff/tif_error.c:56:3: Skipping __function_pointer__(): unresolved function pointer
  54. 	va_start(ap, fmt);
  55. 	if (_TIFFerrorHandler)
  56. 		(*_TIFFerrorHandler)(module, fmt, ap);
        ^
  57. 	if (_TIFFerrorHandlerExt)
  58. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);

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

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

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

libtiff/tif_error.c:60:1: return from a call to TIFFError
  58. 		(*_TIFFerrorHandlerExt)(0, module, fmt, ap);
  59. 	va_end(ap);
  60. }
      ^
  61. 
  62. void

tools/tiff2pdf.c:4056:3: 
4054. 		TIFFError(TIFF2PDF_MODULE,
4055. 			  "Can't get the current time: %s", strerror(errno));
4056. 		timenow = (time_t) 0;
        ^
4057. 	}
4058. 

tools/tiff2pdf.c:4059:2: 
4057. 	}
4058. 
4059. 	currenttime = localtime(&timenow);
       ^
4060. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
4061. 		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",

tools/tiff2pdf.c:4060:2: 
4058. 
4059. 	currenttime = localtime(&timenow);
4060. 	snprintf(t2p->pdf_datetime, sizeof(t2p->pdf_datetime),
       ^
4061. 		 "D:%.4d%.2d%.2d%.2d%.2d%.2d",
4062. 		 (currenttime->tm_year + 1900) % 65536,

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:%.4d%.2d%.2d%.2d%.2d%.2d",
		 (currenttime->tm_year + 1900) % 65536,
		 (currenttime->tm_mon + 1) % 256,
		 (currenttime->tm_mday) % 256,
		 (currenttime->tm_hour) % 256,
		 (currenttime->tm_min) % 256,
		 (currenttime->tm_sec) % 256);
	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:%.4d%.2d%.2d%.2d%.2d%.2d",\n\t\t (currenttime->tm_year + 1900) % 65536,\n\t\t (currenttime->tm_mon + 1) % 256,\n\t\t (currenttime->tm_mday) % 256,\n\t\t (currenttime->tm_hour) % 256,\n\t\t (currenttime->tm_min) % 256,\n\t\t (currenttime->tm_sec) % 256);\n\treturn;\n}', 'void\nTIFFError(const char* module, const char* fmt, ...)\n{\n\tva_list ap;\n\tva_start(ap, fmt);\n\tif (_TIFFerrorHandler)\n\t\t(*_TIFFerrorHandler)(module, fmt, ap);\n\tif (_TIFFerrorHandlerExt)\n\t\t(*_TIFFerrorHandlerExt)(0, module, fmt, ap);\n\tva_end(ap);\n}']