From 3dfc0c847240ac7e12c39f4ed9c31a888949ade1 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 11 May 1998 06:38:36 +0000 Subject: 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) --- source3/param/loadparm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'source3/param/loadparm.c') diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c index 1958986f0b..1b95005c6c 100644 --- a/source3/param/loadparm.c +++ b/source3/param/loadparm.c @@ -1252,7 +1252,8 @@ BOOL lp_add_home(char *pszHomename, int iDefaultService, char *pszHomedir) if (!(*(iSERVICE(i).comment))) { pstring comment; - sprintf(comment,"Home directory of %s",pszHomename); + slprintf(comment,sizeof(comment), + "Home directory of %s",pszHomename); string_set(&iSERVICE(i).comment,comment); } iSERVICE(i).bAvailable = sDefault.bAvailable; @@ -1283,7 +1284,8 @@ static BOOL lp_add_ipc(void) if (i < 0) return(False); - sprintf(comment,"IPC Service (%s)", Globals.szServerString ); + slprintf(comment,sizeof(comment), + "IPC Service (%s)", Globals.szServerString ); string_set(&iSERVICE(i).szPath,tmpdir()); string_set(&iSERVICE(i).szUsername,""); -- cgit