summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKai Blin <kai@samba.org>2008-12-16 13:40:38 -0800
committerJeremy Allison <jra@samba.org>2008-12-16 13:40:38 -0800
commit3144e4508505d03540347879c816ac723c6af158 (patch)
tree669bea4e59338d7bc25aec366f7c223ec721f182
parentcf96098a4868d21752dad2add8fe1dee22fce7ff (diff)
downloadsamba-3144e4508505d03540347879c816ac723c6af158.tar.gz
samba-3144e4508505d03540347879c816ac723c6af158.tar.bz2
samba-3144e4508505d03540347879c816ac723c6af158.zip
(Fixed) Final part of fix for bug #5953 - smbclient crashes: cli_list_new segmentation fault (with NAS-BASIC server).
-rw-r--r--source3/libsmb/clilist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c
index cebafc6919..1431b804b0 100644
--- a/source3/libsmb/clilist.c
+++ b/source3/libsmb/clilist.c
@@ -79,16 +79,17 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx,
p += 27;
p += clistr_align_in(cli, p, 0);
- /* We can safely use +1 here (which is required by OS/2)
- * instead of +2 as the STR_TERMINATE flag below is
+ /* We can safely use len here (which is required by OS/2)
+ * and the NAS-BASIC server instead of +2 or +1 as the
+ * STR_TERMINATE flag below is
* actually used as the length calculation.
- * The len+2 is merely an upper bound.
+ * The len is merely an upper bound.
* Due to the explicit 2 byte null termination
* in cli_receive_trans/cli_receive_nt_trans
* we know this is safe. JRA + kukks
*/
- if (p + len + 1 > pdata_end) {
+ if (p + len > pdata_end) {
return pdata_end - base;
}