1
0
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:
Jeremy Allison
1998-05-12 00:55:32 +00:00
parent 9141acecdc
commit f888868f46
68 changed files with 887 additions and 787 deletions

View File

@ -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);
}