You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If I I'm not missing something, this is a buffer overrun in the snprintf(3) call. I have plans to address it, which include defining this function for use in the entire project:
char*shdw_stpeprintf(char*str, char*past_end, constchar*restrict fmt, ...)
{
intlen;
char*p;
va_listap;
if (str==past_end)
returnpast_end;
if (str==NULL)
returnNULL;
va_start(ap, fmt);
len=vsnprintf(str, past_end-str, fmt, ap);
va_end(ap);
if (len==-1)
returnNULL;
if (len >= past_end-str)
returnpast_end;
returnstr+len;
}
shadow/src/groupmod.c
Line 619 in 37412f5
If I I'm not missing something, this is a buffer overrun in the
snprintf(3)
call. I have plans to address it, which include defining this function for use in the entire project:This is a wrapper for snprintf(3) which allows easy chaining, and detecting truncation. Its design is very similar to stpecpy(3), which I designed here: https://software.codidact.com/posts/285946/287522#answer-287522
The text was updated successfully, but these errors were encountered: