From: Jeremy Allison Date: Thu, 4 Jun 2020 04:07:33 +0000 (-0700) Subject: s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an... X-Git-Tag: ldb-2.2.0~196 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7c3f3add3250e4ec9c9a39aefc1932b6172b04b3;p=thirdparty%2Fsamba.git s3: libsmb: cli_unlink() and async version. Don't allow attribtes > 16 bits on an old protocol send. Signed-off-by: Jeremy Allison Reviewed-by: Volker Lendecke --- diff --git a/source3/libsmb/clifile.c b/source3/libsmb/clifile.c index 65891e0e6a1..d603775b25f 100644 --- a/source3/libsmb/clifile.c +++ b/source3/libsmb/clifile.c @@ -1890,6 +1890,16 @@ struct tevent_req *cli_unlink_send(TALLOC_CTX *mem_ctx, return req; } + if (mayhave_attrs & 0xFFFF0000) { + /* + * Don't allow attributes greater than + * 16-bits for a 16-bit protocol value. + */ + if (tevent_req_nterror(req, NT_STATUS_INVALID_PARAMETER)) { + return tevent_req_post(req, ev); + } + } + SSVAL(state->vwv+0, 0, mayhave_attrs); bytes = talloc_array(state, uint8_t, 1);