diff options
author | Richard Sharpe <sharpe@samba.org> | 2004-03-16 06:56:20 +0000 |
---|---|---|
committer | Richard Sharpe <sharpe@samba.org> | 2004-03-16 06:56:20 +0000 |
commit | 76e86e88c3d578ad47d4bc9ef7e8e6c035715dea (patch) | |
tree | 43cf126db62aa9824b07195f78449e8d4c5b4634 /source3 | |
parent | c377ae98b1e22f95609da7c13ec1868c7a20a9ff (diff) | |
download | samba-76e86e88c3d578ad47d4bc9ef7e8e6c035715dea.tar.gz samba-76e86e88c3d578ad47d4bc9ef7e8e6c035715dea.tar.bz2 samba-76e86e88c3d578ad47d4bc9ef7e8e6c035715dea.zip |
Make sure we don't clobber the stack when response consists of the empty
string.
(This used to be commit e522663717f6b6141580f34502ad8686d326f8c8)
Diffstat (limited to 'source3')
-rw-r--r-- | source3/nsswitch/winbindd_wins.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/source3/nsswitch/winbindd_wins.c b/source3/nsswitch/winbindd_wins.c index bc982d0044..a1eef159c0 100644 --- a/source3/nsswitch/winbindd_wins.c +++ b/source3/nsswitch/winbindd_wins.c @@ -201,7 +201,10 @@ enum winbindd_result winbindd_wins_byname(struct winbindd_cli_state *state) } if (i != 0) { /* Clear out the newline character */ - response[strlen(response)-1] = ' '; + /* But only if there is something in there, + otherwise we clobber something in the stack */ + if (strlen(response)) + response[strlen(response)-1] = ' '; } fstrcat(response,addr); fstrcat(response,"\t"); |