From ed2ed5671bf868234d540cf9e0b887a19d25cc10 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Fri, 26 Dec 1997 10:01:57 +0000 Subject: fixed a couple of illegal uses of scanf() in the nmbd wins code. They caused a core dump under IRIX when compiled with -64. In general you cannot assume things about variable sizes. In particular sizeof(time_t) may not equal sizeof(long) and sizeof(uint16) may not equal sizeof(short). There are probably other bugs like this. We'll need to check all format statements for use of %ld, %hx etc. In general these should not be used unless you have an explicit cast to the appropriate type. (This used to be commit 6ea907e78672558d470e9a819982940a9228e2fa) --- source3/lib/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source3/lib/util.c') diff --git a/source3/lib/util.c b/source3/lib/util.c index 5c81a14c66..403ebb73eb 100644 --- a/source3/lib/util.c +++ b/source3/lib/util.c @@ -3754,7 +3754,7 @@ void standard_sub_basic(char *str) struct passwd *pass; char *username = sam_logon_in_ssb ? samlogon_user : sesssetup_user; - for (s = str ; (p = strchr(s,'%')) != NULL ; s = p ) + for (s = str ; s && *s && (p = strchr(s,'%')); s = p ) { switch (*(p+1)) { -- cgit