tools/tiffcrop.c:7210: error: Null Dereference
  pointer `sect_buff` last assigned on line 7208 could be null and is dereferenced by call to `_TIFFmemset()` at line 7210, column 5.

tools/tiffcrop.c:7197:1: start of procedure createImageSection()
7195. 
7196. /* Create a buffer to write one section at a time */
7197. static int
      ^
7198. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
7199.   {

tools/tiffcrop.c:7200:3: 
7198. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
7199.   {
7200.   unsigned  char *sect_buff = NULL;
        ^
7201.   unsigned  char *new_buff  = NULL;
7202.   static    uint32  prev_sectsize = 0;

tools/tiffcrop.c:7201:3: 
7199.   {
7200.   unsigned  char *sect_buff = NULL;
7201.   unsigned  char *new_buff  = NULL;
        ^
7202.   static    uint32  prev_sectsize = 0;
7203.   

tools/tiffcrop.c:7202:3: 
7200.   unsigned  char *sect_buff = NULL;
7201.   unsigned  char *new_buff  = NULL;
7202.   static    uint32  prev_sectsize = 0;
        ^
7203.   
7204.   sect_buff = *sect_buff_ptr;

tools/tiffcrop.c:7204:3: 
7202.   static    uint32  prev_sectsize = 0;
7203.   
7204.   sect_buff = *sect_buff_ptr;
        ^
7205. 
7206.   if (!sect_buff)

tools/tiffcrop.c:7206:8: Taking true branch
7204.   sect_buff = *sect_buff_ptr;
7205. 
7206.   if (!sect_buff)
             ^
7207.     {
7208.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);

tools/tiffcrop.c:7208:5: 
7206.   if (!sect_buff)
7207.     {
7208.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
          ^
7209.     *sect_buff_ptr = sect_buff;
7210.     _TIFFmemset(sect_buff, 0, sectsize);

libtiff/tif_unix.c:277:1: start of procedure _TIFFmalloc()
  275. #endif
  276. 
  277. void*
       ^
  278. _TIFFmalloc(tmsize_t s)
  279. {

libtiff/tif_unix.c:280:13: Taking false branch
  278. _TIFFmalloc(tmsize_t s)
  279. {
  280.         if (s == 0)
                   ^
  281.                 return ((void *) NULL);
  282. 

libtiff/tif_unix.c:283:2: 
  281.                 return ((void *) NULL);
  282. 
  283. 	return (malloc((size_t) s));
        ^
  284. }
  285. 

libtiff/tif_unix.c:284:1: return from a call to _TIFFmalloc
  282. 
  283. 	return (malloc((size_t) s));
  284. }
       ^
  285. 
  286. void

tools/tiffcrop.c:7209:5: 
7207.     {
7208.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
7209.     *sect_buff_ptr = sect_buff;
          ^
7210.     _TIFFmemset(sect_buff, 0, sectsize);
7211.     }

tools/tiffcrop.c:7210:5: 
7208.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
7209.     *sect_buff_ptr = sect_buff;
7210.     _TIFFmemset(sect_buff, 0, sectsize);
          ^
7211.     }
7212.   else

libtiff/tif_unix.c:298:1: start of procedure _TIFFmemset()
  296. }
  297. 
  298. void
       ^
  299. _TIFFmemset(void* p, int v, tmsize_t c)
  300. {

libtiff/tif_unix.c:301:2: 
  299. _TIFFmemset(void* p, int v, tmsize_t c)
  300. {
  301. 	memset(p, v, (size_t) c);
        ^
  302. }
  303. 

libtiff/tif_unix.c:302:1: return from a call to _TIFFmemset
  300. {
  301. 	memset(p, v, (size_t) c);
  302. }
       ^
  303. 
  304. void

static int
createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
  {
  unsigned  char *sect_buff = NULL;
  unsigned  char *new_buff  = NULL;
  static    uint32  prev_sectsize = 0;
  sect_buff = *sect_buff_ptr;
  if (!sect_buff)
    {
    sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
    *sect_buff_ptr = sect_buff;
    _TIFFmemset(sect_buff, 0, sectsize);
    }
  else
    {
    if (prev_sectsize < sectsize)
      {
      new_buff = _TIFFrealloc(sect_buff, sectsize);
      if (!new_buff)
        {
	free (sect_buff);
        sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
        }
      else
        sect_buff = new_buff;
      _TIFFmemset(sect_buff, 0, sectsize);
      }
    }
  if (!sect_buff)
    {
    TIFFError("createImageSection", "Unable to allocate/reallocate section buffer");
    return (-1);
    }
  prev_sectsize = sectsize;
  *sect_buff_ptr = sect_buff;
  return (0);
  }
['static int\ncreateImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)\n  {\n  unsigned  char *sect_buff = NULL;\n  unsigned  char *new_buff  = NULL;\n  static    uint32  prev_sectsize = 0;\n  sect_buff = *sect_buff_ptr;\n  if (!sect_buff)\n    {\n    sect_buff = (unsigned char *)_TIFFmalloc(sectsize);\n    *sect_buff_ptr = sect_buff;\n    _TIFFmemset(sect_buff, 0, sectsize);\n    }\n  else\n    {\n    if (prev_sectsize < sectsize)\n      {\n      new_buff = _TIFFrealloc(sect_buff, sectsize);\n      if (!new_buff)\n        {\n\tfree (sect_buff);\n        sect_buff = (unsigned char *)_TIFFmalloc(sectsize);\n        }\n      else\n        sect_buff = new_buff;\n      _TIFFmemset(sect_buff, 0, sectsize);\n      }\n    }\n  if (!sect_buff)\n    {\n    TIFFError("createImageSection", "Unable to allocate/reallocate section buffer");\n    return (-1);\n    }\n  prev_sectsize = sectsize;\n  *sect_buff_ptr = sect_buff;\n  return (0);\n  }', 'void*\n_TIFFmalloc(tmsize_t s)\n{\n        if (s == 0)\n                return ((void *) NULL);\n\treturn (malloc((size_t) s));\n}', 'void\n_TIFFmemset(void* p, int v, tmsize_t c)\n{\n\tmemset(p, v, (size_t) c);\n}']