diff options
author | Jeremy Allison <jra@samba.org> | 2014-08-25 17:11:58 -0700 |
---|---|---|
committer | David Disseldorp <ddiss@samba.org> | 2014-09-16 01:56:54 +0200 |
commit | 0519088c53b201b7ca1f144f3f2da052c612c0e7 (patch) | |
tree | 59d41b8d7869877d0c8579fb2663817a618f9f84 /source3/smbd/lanman.c | |
parent | c7b89bb9e5531be378c1b71fa7165f3ce74c83bb (diff) | |
download | samba-0519088c53b201b7ca1f144f3f2da052c612c0e7.tar.gz samba-0519088c53b201b7ca1f144f3f2da052c612c0e7.tar.xz samba-0519088c53b201b7ca1f144f3f2da052c612c0e7.zip |
s3: smbd: Change the function signature of srvstr_push() from returning a length to returning an NTSTATUS with a length param.
srvstr_push_fn() now returns an NTSTATUS reporting any
string conversion failure.
We need to get serious about returning character set conversion errors
inside smbd.
Bug 10775 - smbd crashes when accessing garbage filenames
https://bugzilla.samba.org/show_bug.cgi?id=10775
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Diffstat (limited to 'source3/smbd/lanman.c')
-rw-r--r-- | source3/smbd/lanman.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/smbd/lanman.c b/source3/smbd/lanman.c index b7c74e907b..ac4873decc 100644 --- a/source3/smbd/lanman.c +++ b/source3/smbd/lanman.c @@ -3655,8 +3655,13 @@ static bool api_RNetServerGetInfo(struct smbd_server_connection *sconn, } if (uLevel != 20) { - srvstr_push(NULL, 0, p, info.info101->server_name, 16, - STR_ASCII|STR_UPPER|STR_TERMINATE); + size_t len = 0; + status = srvstr_push(NULL, 0, p, info.info101->server_name, 16, + STR_ASCII|STR_UPPER|STR_TERMINATE, &len); + if (!NT_STATUS_IS_OK(status)) { + errcode = W_ERROR_V(ntstatus_to_werror(status)); + goto out; + } } p += 16; if (uLevel > 0) { |