diff options
author | Andrew Tridgell <tridge@samba.org> | 1998-05-11 06:38:36 +0000 |
---|---|---|
committer | Andrew Tridgell <tridge@samba.org> | 1998-05-11 06:38:36 +0000 |
commit | 3dfc0c847240ac7e12c39f4ed9c31a888949ade1 (patch) | |
tree | 305f006b62ed9dcdca0f751dbf40d2a34ee054df /source3/lib/charset.c | |
parent | ffc88e2d26217f99c34ce24c0836bec3c809ca1a (diff) | |
download | samba-3dfc0c847240ac7e12c39f4ed9c31a888949ade1.tar.gz samba-3dfc0c847240ac7e12c39f4ed9c31a888949ade1.tar.bz2 samba-3dfc0c847240ac7e12c39f4ed9c31a888949ade1.zip |
changed to use slprintf() instead of sprintf() just about
everywhere. I've implemented slprintf() as a bounds checked sprintf()
using mprotect() and a non-writeable page.
This should prevent any sprintf based security holes.
(This used to be commit ee09e9dadb69aaba5a751dd20ccc6d587d841bd6)
Diffstat (limited to 'source3/lib/charset.c')
-rw-r--r-- | source3/lib/charset.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source3/lib/charset.c b/source3/lib/charset.c index fe170bdcf5..d8ce38f396 100644 --- a/source3/lib/charset.c +++ b/source3/lib/charset.c @@ -203,7 +203,9 @@ static codepage_p load_client_codepage( int client_codepage ) strcpy(codepage_file_name, CODEPAGEDIR); strcat(codepage_file_name, "/"); strcat(codepage_file_name, "codepage."); - sprintf( &codepage_file_name[strlen(codepage_file_name)], "%03d", + slprintf(&codepage_file_name[strlen(codepage_file_name)], + sizeof(pstring)-(strlen(codepage_file_name)+1), + "%03d", client_codepage); if(!file_exist(codepage_file_name,&st)) |