mirror of
https://github.com/samba-team/samba.git
synced 2025-08-02 00:22:11 +03:00
This is a security audit change of the main source.
It removed all ocurrences of the following functions :
sprintf
strcpy
strcat
The replacements are slprintf, safe_strcpy and safe_strcat.
It should not be possible to use code in Samba that uses
sprintf, strcpy or strcat, only the safe_equivalents.
Once Andrew has fixed the slprintf implementation then
this code will be moved back to the 1.9.18 code stream.
Jeremy.
(This used to be commit 2d77445400
)
This commit is contained in:
@ -165,18 +165,18 @@ char *smb_errstr(char *inbuf)
|
||||
if (num == err[j].code)
|
||||
{
|
||||
if (DEBUGLEVEL > 0)
|
||||
sprintf(ret,"%s - %s (%s)",err_classes[i].class,
|
||||
slprintf(ret, sizeof(ret) - 1, "%s - %s (%s)",err_classes[i].class,
|
||||
err[j].name,err[j].message);
|
||||
else
|
||||
sprintf(ret,"%s - %s",err_classes[i].class,err[j].name);
|
||||
slprintf(ret, sizeof(ret) - 1, "%s - %s",err_classes[i].class,err[j].name);
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
sprintf(ret,"%s - %d",err_classes[i].class,num);
|
||||
slprintf(ret, sizeof(ret) - 1, "%s - %d",err_classes[i].class,num);
|
||||
return ret;
|
||||
}
|
||||
|
||||
sprintf(ret,"Error: Unknown error (%d,%d)",class,num);
|
||||
slprintf(ret, sizeof(ret) - 1, "Error: Unknown error (%d,%d)",class,num);
|
||||
return(ret);
|
||||
}
|
||||
|
Reference in New Issue
Block a user