summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGerald Carter <jerry@samba.org>2002-08-22 02:51:32 +0000
committerGerald Carter <jerry@samba.org>2002-08-22 02:51:32 +0000
commit7c4d1ba0581dfd152a876f8726124938515410bd (patch)
tree0bdef0cebb89c43ac3ed2c29df46c4e7b20537a8
parenta1e32fee3957d0566a4c089dd5750541c15c843f (diff)
downloadsamba-7c4d1ba0581dfd152a876f8726124938515410bd.tar.gz
samba-7c4d1ba0581dfd152a876f8726124938515410bd.tar.bz2
samba-7c4d1ba0581dfd152a876f8726124938515410bd.zip
fix a few segfaults
(This used to be commit ccb02f7cfcec4a555cf7304816c739f4bf7b46f0)
-rw-r--r--source3/lib/system.c12
-rw-r--r--source3/libsmb/namecache.c2
2 files changed, 7 insertions, 7 deletions
diff --git a/source3/lib/system.c b/source3/lib/system.c
index 8822d3c414..873b8737d5 100644
--- a/source3/lib/system.c
+++ b/source3/lib/system.c
@@ -1233,23 +1233,23 @@ int sys_dup2(int oldfd, int newfd)
Wrapper for Admin Logs.
****************************************************************************/
-void sys_adminlog(int priority, const char *format_str, ...)
+void sys_adminlog(int priority, char *format_str, ...)
{
va_list ap;
int ret;
- char **msgbuf = NULL;
+ char *msgbuf = NULL;
va_start( ap, format_str );
- ret = vasprintf( msgbuf, format_str, ap );
+ ret = vasprintf( &msgbuf, format_str, ap );
va_end( ap );
if (ret == -1)
return;
#if defined(HAVE_SYSLOG)
- syslog( priority, "%s", *msgbuf );
+ syslog( priority, "%s", msgbuf );
#else
- DEBUG(0,("%s", *msgbuf ));
+ DEBUG(0,("%s", msgbuf ));
#endif
- SAFE_FREE(*msgbuf);
+ SAFE_FREE(msgbuf);
}
diff --git a/source3/libsmb/namecache.c b/source3/libsmb/namecache.c
index 88dbcf218d..f05f76a22b 100644
--- a/source3/libsmb/namecache.c
+++ b/source3/libsmb/namecache.c
@@ -101,7 +101,7 @@ static TDB_DATA namecache_value(struct in_addr *ip_list, int num_names,
value->expiry = expiry;
value->count = num_names;
- memcpy(value->ip_list, ip_list, size);
+ memcpy(value->ip_list, ip_list, sizeof(*ip_list));
retval.dptr = (char *)value;
retval.dsize = size;