From d5ee9b2f480ddbda0b8f69409698d27c99384f9c Mon Sep 17 00:00:00 2001 From: Andrew Bartlett Date: Tue, 18 Mar 2003 11:22:52 +0000 Subject: Jeremy merged across my string parinoia fixes, but forgot to enable them! :-) This patch catches up on the rest of the work - as much string checking as is possible is done at compile time, and the rest at runtime. Lots of code converted to pstrcpy() etc, and other code reworked to correctly call sizeof(). Andrew Bartlett (This used to be commit c5b604e2ee67d74241ae2fa07ae904647d35a2be) --- source3/nsswitch/winbindd_wins.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'source3/nsswitch') diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c index 8ddd5dc10d..a1d38ed69a 100644 --- a/source3/nsswitch/winbindd_wins.c +++ b/source3/nsswitch/winbindd_wins.c @@ -137,8 +137,8 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) SAFE_FREE(status); return WINBINDD_ERROR; } - safe_strcat(response,state->request.data.winsreq,maxlen); - safe_strcat(response,"\t",maxlen); + fstrcat(response,state->request.data.winsreq); + fstrcat(response,"\t"); for (i = 0; i < count; i++) { /* ignore group names */ if (status[i].flags & 0x80) continue; @@ -148,8 +148,8 @@ enum winbindd_result winbindd_wins_byip(struct winbindd_cli_state *state) SAFE_FREE(status); return WINBINDD_ERROR; } - safe_strcat(response, status[i].name, maxlen); - safe_strcat(response, " ", maxlen); + fstrcat(response, status[i].name); + fstrcat(response, " "); } } /* make last character a newline */ @@ -190,16 +190,16 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state) /* Clear out the newline character */ response[strlen(response)-1] = ' '; } - safe_strcat(response,addr,maxlen); - safe_strcat(response,"\t",maxlen); + fstrcat(response,addr); + fstrcat(response,"\t"); } size = strlen(state->request.data.winsreq) + strlen(response); if (size > maxlen) { SAFE_FREE(ip_list); return WINBINDD_ERROR; } - safe_strcat(response,state->request.data.winsreq,maxlen); - safe_strcat(response,"\n",maxlen); + fstrcat(response,state->request.data.winsreq); + fstrcat(response,"\n"); SAFE_FREE(ip_list); } else return WINBINDD_ERROR; -- cgit