vbox6: add null pointer check for clipboard

Check 'pv == nullptr' in 'ShClSvcImplWriteData' and return
VERR_INVALID_POINTER if invalid (as is done, for example, in the X11
implementation).

issue #4666
This commit is contained in:
Sebastian Sumpf 2022-11-17 11:30:50 +01:00 committed by Christian Helmuth
parent 41d0c89a52
commit 2c92fc4b6f

View File

@ -164,6 +164,9 @@ int ShClSvcImplWriteData(PSHCLCLIENT, PSHCLCLIENTCMDCTX, SHCLFORMAT fFormat, voi
if (!(fFormat & VBOX_SHCL_FMT_UNICODETEXT)) if (!(fFormat & VBOX_SHCL_FMT_UNICODETEXT))
return VERR_NOT_IMPLEMENTED; return VERR_NOT_IMPLEMENTED;
if (pv == nullptr)
return VERR_INVALID_POINTER;
Clipboard::Guard guard; Clipboard::Guard guard;
PCRTUTF16 const utf16_string = (PCRTUTF16)pv; PCRTUTF16 const utf16_string = (PCRTUTF16)pv;