From 7dd3ed26ca09df0e582be8cc2780bba588bdd11e Mon Sep 17 00:00:00 2001 From: P Dheeraj Srujan Kumar Date: Fri, 2 Dec 2022 23:23:31 +0530 Subject: Update to internal 1-0.92 Signed-off-by: P Dheeraj Srujan Kumar --- ...for-possible-freeing-of-mismatched-memory.patch | 39 ++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 meta-openbmc-mods/meta-common/recipes-devtools/mtd-util/files/0002-Add-fix-for-possible-freeing-of-mismatched-memory.patch (limited to 'meta-openbmc-mods/meta-common/recipes-devtools/mtd-util/files/0002-Add-fix-for-possible-freeing-of-mismatched-memory.patch') diff --git a/meta-openbmc-mods/meta-common/recipes-devtools/mtd-util/files/0002-Add-fix-for-possible-freeing-of-mismatched-memory.patch b/meta-openbmc-mods/meta-common/recipes-devtools/mtd-util/files/0002-Add-fix-for-possible-freeing-of-mismatched-memory.patch new file mode 100644 index 000000000..1c5bc5843 --- /dev/null +++ b/meta-openbmc-mods/meta-common/recipes-devtools/mtd-util/files/0002-Add-fix-for-possible-freeing-of-mismatched-memory.patch @@ -0,0 +1,39 @@ +From 5606cfc0857dc6fe1071c14f6906d866048f6c18 Mon Sep 17 00:00:00 2001 +From: AkshayRav +Date: Thu, 28 Apr 2022 13:57:32 +0530 +Subject: [PATCH] Add fix for possible freeing of mismatched memory (#8) + +* Add fix for possible freeing of mismatched memory + +Memory referenced by "buf" was allocated through function +"new[]" and released through function "delete". The fix changes the +release function to "delete[]" to remove the possible freeing of +mismatched memory. + +Signed-off-by: AKSHAY RAVEENDRAN K +--- + mtd-util.cpp | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/mtd-util.cpp b/mtd-util.cpp +index 7f2f98d..d6136f0 100644 +--- a/mtd-util.cpp ++++ b/mtd-util.cpp +@@ -391,7 +391,7 @@ int main(int argc, char* argv[]) + { + std::cerr << "failed to parse '" << argv[optind] + << "' as integer" << std::endl; +- delete buf; ++ delete[] buf; + return 1; + } + optind++; +@@ -473,7 +473,7 @@ int main(int argc, char* argv[]) + break; + case ACTION_WRITE_TO_FLASH: + ret = buf_to_flash(dev, buf, start, len); +- delete buf; ++ delete[] buf; + break; + #endif /* DEVELOPER_OPTIONS */ + case ACTION_CP_TO_FILE: -- cgit v1.2.3