fix bad memcpy length
PATCH 1/1 fix bad memcpy length
qemu/trunk/hw/bt-sdp.c +1 -1
@@ -254,7 +254,7 @@/* Perform the search */ if (len <7 )return -SDP_INVALID_SYNTAX ; -memcpy (&handle, req,6 ); +memcpy (&handle, req,4 ); req +=4 ; len -=4 ;
Signed-off-by <[email protected]>
qemu/trunk/hw/bt-sdp.c line 257
Quoted 8 lines · Bruce Rogers
qemu/trunk/hw/bt-sdp.c +1
-1@@ -254,7 +254,7 @@/* Perform the search */ if (len <7 )return -SDP_INVALID_SYNTAX ; -memcpy (&handle, req,6 ); +memcpy (&handle, req,4 );
Changing one magic number to another doesn't make much sense. Why not this instead:
memcpy(&handle, req, sizeof (handle));
Erik
Signature · 4 lines
----------------------------------------------------------------- Erik de Castro Lopo ----------------------------------------------------------------- "life is too long to know C++ well" -- Erik Naggum