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

tools/tiffcrop.c:7322:1: start of procedure createImageSection()
7320. 
7321. /* Create a buffer to write one section at a time */
7322. static int
      ^
7323. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
7324.   {

tools/tiffcrop.c:7325:3: 
7323. createImageSection(uint32 sectsize, unsigned char **sect_buff_ptr)
7324.   {
7325.   unsigned  char *sect_buff = NULL;
        ^
7326.   unsigned  char *new_buff  = NULL;
7327.   static    uint32  prev_sectsize = 0;

tools/tiffcrop.c:7326:3: 
7324.   {
7325.   unsigned  char *sect_buff = NULL;
7326.   unsigned  char *new_buff  = NULL;
        ^
7327.   static    uint32  prev_sectsize = 0;
7328.   

tools/tiffcrop.c:7327:3: 
7325.   unsigned  char *sect_buff = NULL;
7326.   unsigned  char *new_buff  = NULL;
7327.   static    uint32  prev_sectsize = 0;
        ^
7328.   
7329.   sect_buff = *sect_buff_ptr;

tools/tiffcrop.c:7329:3: 
7327.   static    uint32  prev_sectsize = 0;
7328.   
7329.   sect_buff = *sect_buff_ptr;
        ^
7330. 
7331.   if (!sect_buff)

tools/tiffcrop.c:7331:8: Taking true branch
7329.   sect_buff = *sect_buff_ptr;
7330. 
7331.   if (!sect_buff)
             ^
7332.     {
7333.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);

tools/tiffcrop.c:7333:5: 
7331.   if (!sect_buff)
7332.     {
7333.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
          ^
7334.     *sect_buff_ptr = sect_buff;
7335.     _TIFFmemset(sect_buff, 0, sectsize);

libtiff/tif_unix.c:310:1: start of procedure _TIFFmalloc()
  308. #endif
  309. 
  310. void*
       ^
  311. _TIFFmalloc(tmsize_t s)
  312. {

libtiff/tif_unix.c:313:13: Taking false branch
  311. _TIFFmalloc(tmsize_t s)
  312. {
  313.         if (s == 0)
                   ^
  314.                 return ((void *) NULL);
  315. 

libtiff/tif_unix.c:316:2: 
  314.                 return ((void *) NULL);
  315. 
  316. 	return (malloc((size_t) s));
        ^
  317. }
  318. 

libtiff/tif_unix.c:317:1: return from a call to _TIFFmalloc
  315. 
  316. 	return (malloc((size_t) s));
  317. }
       ^
  318. 
  319. void* _TIFFcalloc(tmsize_t nmemb, tmsize_t siz)

tools/tiffcrop.c:7334:5: 
7332.     {
7333.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
7334.     *sect_buff_ptr = sect_buff;
          ^
7335.     _TIFFmemset(sect_buff, 0, sectsize);
7336.     }

tools/tiffcrop.c:7335:5: 
7333.     sect_buff = (unsigned char *)_TIFFmalloc(sectsize);
7334.     *sect_buff_ptr = sect_buff;
7335.     _TIFFmemset(sect_buff, 0, sectsize);
          ^
7336.     }
7337.   else

libtiff/tif_unix.c:339:1: start of procedure _TIFFmemset()
  337. }
  338. 
  339. void
       ^
  340. _TIFFmemset(void* p, int v, tmsize_t c)
  341. {

libtiff/tif_unix.c:342:2: 
  340. _TIFFmemset(void* p, int v, tmsize_t c)
  341. {
  342. 	memset(p, v, (size_t) c);
        ^
  343. }
  344. 

libtiff/tif_unix.c:343:1: return from a call to _TIFFmemset
  341. {
  342. 	memset(p, v, (size_t) c);
  343. }
       ^
  344. 
  345. 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}']