Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 99d0823c authored by Shruti Bihani's avatar Shruti Bihani
Browse files

Fix Segv on unknown address error flagged by fuzzer test.

The error is thrown when the destructor tries to free pointer memory.
This is happening for cases where the pointer was not initialized. Initializing it to a default value fixes the error.

Bug: 245135112
Test: Build mtp_host_property_fuzzer and run on the target device
Change-Id: I255cd68b7641e96ac47ab81479b9b46b78c15580
Merged-In: I255cd68b7641e96ac47ab81479b9b46b78c15580
(cherry picked from commit 3afa6e80)
parent 8f8d0834
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -26,6 +26,9 @@ namespace android {
class MtpDataPacket;

struct MtpPropertyValue {
    // pointer str initialized to NULL so that free operation
    // is not called for pre-assigned value
    MtpPropertyValue() : str (NULL) {}
    union {
        int8_t          i8;
        uint8_t         u8;