pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: wip/squid4 compilation error



On 26/04/2019 10:47, Mayuresh wrote:
  Fs::Ufs::RebuildState::getNextFile(sfileno * filn_p, int *)
  ^~
ufs/RebuildState.cc:428:21: note: 'snprintf' output between 2 and 768
bytes into a destination of size 512
              snprintf(fullfilename, sizeof(fullfilename), "%s/%s",
              ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                       fullpath, entry->d_name);
                       ~~~~~~~~~~~~~~~~~~~~~~~~
At present have just increased the size of the concerned variable. But
sharing to seek better patch ideas.

Disable the warning? I can see the point of that warning with sprintf and any string function that doesn't null terminate but for snprintf the worst case scenario is that the filename in this case gets shortened. Whilst that could lead to an odd file access in a process running as root which would be detrimental its a lot less harmless in a typical daemon that has dropped its root priveleges. Not to mention that 512 bytes is actually a wildly long filename so in any rationally configured setup the buffer is already way bigger than it needs to be.

Mike


Home | Main Index | Thread Index | Old Index