diff options
author | Stefan Metzmacher <metze@samba.org> | 2011-07-06 18:57:27 +0200 |
---|---|---|
committer | Stefan Metzmacher <metze@samba.org> | 2011-07-07 19:16:27 +0200 |
commit | d921200e75e90fbda2cf7ba7950ae71e09c50468 (patch) | |
tree | aad59945d8c1ee941fc22d62c2b4865513467890 /source3/libsmb | |
parent | af66c64e95183647bce39754089c591cbbdfbc50 (diff) | |
download | samba-d921200e75e90fbda2cf7ba7950ae71e09c50468.tar.gz samba-d921200e75e90fbda2cf7ba7950ae71e09c50468.tar.bz2 samba-d921200e75e90fbda2cf7ba7950ae71e09c50468.zip |
s3:libsmb: use clistr_pull_talloc() for short_name in interpret_long_filename()
metze
Diffstat (limited to 'source3/libsmb')
-rw-r--r-- | source3/libsmb/clilist.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/source3/libsmb/clilist.c b/source3/libsmb/clilist.c index 0792e4057b..a9270fbb35 100644 --- a/source3/libsmb/clilist.c +++ b/source3/libsmb/clilist.c @@ -189,9 +189,16 @@ static size_t interpret_long_filename(TALLOC_CTX *ctx, return pdata_end - base; } p += 2; - clistr_pull(base_ptr, finfo->short_name, p, - sizeof(finfo->short_name), - slen, STR_UNICODE); + ret = clistr_pull_talloc(ctx, + base_ptr, + recv_flags2, + &finfo->short_name, + p, + slen, + STR_UNICODE); + if (ret == (size_t)-1) { + return pdata_end - base; + } p += 24; /* short name? */ if (p + namelen < p || p + namelen > pdata_end) { return pdata_end - base; @@ -258,9 +265,10 @@ static bool interpret_short_filename(TALLOC_CTX *ctx, } if (finfo->name) { - strlcpy(finfo->short_name, - finfo->name, - sizeof(finfo->short_name)); + finfo->short_name = talloc_strdup(ctx, finfo->name); + if (finfo->short_name == NULL) { + return false; + } } return true; } |