Fix potential heap data leak in mediadrmserver
Change-Id: Ife4cecaeb5e301d702681c6dba9a17357232db40
related-to-bug: 31657897
diff --git a/media/libmedia/ICrypto.cpp b/media/libmedia/ICrypto.cpp
index 495e3f9..302e6ee 100644
--- a/media/libmedia/ICrypto.cpp
+++ b/media/libmedia/ICrypto.cpp
@@ -373,7 +373,7 @@
// data back via the shared buffer rather than
// copying it separately over binder to avoid
// binder's 1MB limit.
- memcpy(sharedBuffer->pointer(), dstPtr, totalSize);
+ memcpy(sharedBuffer->pointer(), dstPtr, result);
}
free(dstPtr);
dstPtr = NULL;