USB_UDE_Sample
USB_UDE_Sample copied to clipboard
Initialize ResultLength to fix code analysis warning
Fixes the following warning when running Code Analysis from Visual Studio:
USB_UDE_Sample\UDEFX2\Device.c(571): warning C6101: Returning uninitialized memory '*ResultLength'. A successful path through the function does not set the named _Out_ parameter.
the parameter is market as optional (Opt) in the annotations, but it is being set before being checked against NULL.. we probably can't do that.
the parameter is market as optional (Opt) in the annotations, but it is being set before being checked against NULL.. we probably can't do that.
The ResultLength
argument is annotated as _Out_
, which makes it mandatory. It should therefore be safe to write to without checking first. It's the OutputBuffer
argument that is annotated as _Out_writes_to_opt_
.
@xxandy Would it be possible for you to consider this PR?
@xxandy Would it be possible for you to consider this PR?