On 10/16/2011 08:14 AM, Thomas Jarosch wrote:
> sizeof (char *) will return the size of the pointer.
> On 64 bit platforms this will return eight and
> lead to an out-of-bounds buffer access.

Applied, thanks!

https://github.com/autotest/autotest/commit/90b02fe3212fcb99671dac4df844fa16f35b9001

> Detected by "cppcheck"
>
> Signed-off-by: Thomas Jarosch<[email protected]>
> ---
>   client/tests/kvm/deps/finish.cpp |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/tests/kvm/deps/finish.cpp 
> b/client/tests/kvm/deps/finish.cpp
> index 11f78fb..567e13e 100644
> --- a/client/tests/kvm/deps/finish.cpp
> +++ b/client/tests/kvm/deps/finish.cpp
> @@ -121,7 +121,7 @@ int main(int argc, char **argv)
>       closesocket(ListenSocket);
>
>       // Send the ack string to the client
> -    iSendResult = send(ClientSocket, sendbuf, sizeof(sendbuf), 0);
> +    iSendResult = send(ClientSocket, sendbuf, strlen(sendbuf), 0);
>       if (iSendResult == SOCKET_ERROR) {
>           closesocket(ClientSocket);
>           ExitOnError("Send failed", TRUE);

_______________________________________________
Autotest mailing list
[email protected]
http://test.kernel.org/cgi-bin/mailman/listinfo/autotest

Reply via email to