diff options
author | Noel Power <noel.power@suse.com> | 2019-08-13 15:57:22 +0100 |
---|---|---|
committer | Ralph Boehme <slow@samba.org> | 2019-10-22 18:48:43 +0000 |
commit | 6ebd0ba735e6fdddc4d7ded57879d85a42aabf05 (patch) | |
tree | eee074e2c9861ec6c7005fb726c7e60dd68bd8e8 /source3/libsmb | |
parent | 4ef40d41f606f631411991101ed826733a74a8b7 (diff) | |
download | samba-6ebd0ba735e6fdddc4d7ded57879d85a42aabf05.tar.gz |
s3/libsmb: clang: Fix 'the left operand of '-' is a garbage value'
Fixes:
source3/libsmb/clifile.c:360:19: warning: The left operand of '-' is a garbage value <--[clang]
if (data[num_data-1] != '\0') {
~~~~~~~~^
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Tue Oct 22 18:48:43 UTC 2019 on sn-devel-184
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clifile.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 987b04d0a66..dd08b0e30f3 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -344,7 +344,7 @@ static void cli_posix_readlink_done(struct tevent_req *subreq) req, struct cli_posix_readlink_state); NTSTATUS status; uint8_t *data = NULL; - uint32_t num_data; + uint32_t num_data = 0; charset_t charset; size_t converted_size; bool ok; @@ -357,7 +357,7 @@ static void cli_posix_readlink_done(struct tevent_req *subreq) /* * num_data is > 1, we've given 1 as minimum to cli_qpathinfo_send */ - if (data[num_data-1] != '\0') { + if (data == NULL || data[num_data-1] != '\0') { tevent_req_nterror(req, NT_STATUS_DATA_ERROR); return; } |