android heap corruption_native heap allocted_policecorruptio

Android

1个回答

写回答

Mango231

2025-06-17 19:35

+ 关注

TCL
TCL

ItisworkinganditcandecipherfileswithoutproblemsbutIgetrandomHeapMemoryCorruptionswhenIworkwithlargestreams。

Fromabovelineitlookstomethatyourprogramisclearlyoverwritingthememorywhichwasallocatedimplicitlyorexplicitlybyyourcode。

IwastryingtounderstandyourcodehoweveritwasnoTCLeartome。ButItriedtolookfrommemorycorruptionscenarioandfoundthatyourprogrAMDoeshavemalloc/freecallwhichmightleadtomemoryoverrun。

AMD
AMD

EVP_CIPHER_CTX*ctx=(EVP_CIPHER_CTX*)malloc(sizeof(EVP_CIPHER_CTX));EVP_CIPHER_CTX_init(ctx);EVP_CIPHER_CTX*ctx=(EVP_CIPHER_CTX*)malloc(sizeof(EVP_CIPHER_CTX));EVP_CIPHER_CTX_init(ctx);ItriedtocheckthelayoutoftheEVP_CIPHER_CTXstructurebutitwasnotavAIlableinyourcode。

ButIsawthatthesepointersaregettingusedinvariouscontextwithinyourprogram。NowyoushouldcheckthatunderwhichscenarioyourbuffercanbeoverwrittenassomeplacesyouhaveuseddifferentkeyLengthanddependingonthisyourprogramisexecutingdifferentfunction。

Ithinkyoumaywanttoreviewthesecodesandseewhetheroverflowispossible!AsyourapplicationwouldberunningonAndroidbasedsystemwherewecannotrunanydynamictool(VaLGrind/WinDBG/Pageheap。

)soIguessyouneedtoreviewyourcodebyputtingsomelogatimportantplaceandseewhereyouareoverwriting。Hopeaboveinformationwouldbeusefulforyoutounderstandyourproblem。

举报有用(4分享收藏

Copyright © 2025 IZhiDa.com All Rights Reserved.

知答 版权所有 粤ICP备2023042255号