REAL5EC1CFF Telegram 207
这段 proc maps 解析代码存在什么问题?

1. 垂悬指针(L45-46,L33-34,L19-20)
2. 可能的缓冲区溢出(L36, sscanf %s 未指定宽度)
3. buffer 分配过多或过少(L32, 5 足矣,L33, PATH_MAX=4096)
4. 逻辑不严谨(L30, L39-41)
5. 无用的重复代码(L42)
6. 不检查 sscanf 结果是否正确
7. 文件未关闭(L27)

这段代码来源于一个经过一定程度的传播的 github 仓库。我的一个朋友由于使用了这段代码,导致程序产生 bug 。这件事告诉我们不要随便复制粘贴看起来可靠的代码。

附频道主认为的优秀的 proc maps 解析程序的 C++ 实现,供参考:https://github.com/LSPosed/LSPlt/blob/a674793be6bc060b6d695c0cb481e8262c763885/lsplt/src/main/jni/lsplt.cc#L245

2024.05.23 改进了部分措辞



tgoop.com/real5ec1cff/207
Create:
Last Update:

这段 proc maps 解析代码存在什么问题?

1. 垂悬指针(L45-46,L33-34,L19-20)
2. 可能的缓冲区溢出(L36, sscanf %s 未指定宽度)
3. buffer 分配过多或过少(L32, 5 足矣,L33, PATH_MAX=4096)
4. 逻辑不严谨(L30, L39-41)
5. 无用的重复代码(L42)
6. 不检查 sscanf 结果是否正确
7. 文件未关闭(L27)

这段代码来源于一个经过一定程度的传播的 github 仓库。我的一个朋友由于使用了这段代码,导致程序产生 bug 。这件事告诉我们不要随便复制粘贴看起来可靠的代码。

附频道主认为的优秀的 proc maps 解析程序的 C++ 实现,供参考:https://github.com/LSPosed/LSPlt/blob/a674793be6bc060b6d695c0cb481e8262c763885/lsplt/src/main/jni/lsplt.cc#L245

2024.05.23 改进了部分措辞

BY 5ec1cff




Share with your friend now:
tgoop.com/real5ec1cff/207

View MORE
Open in Telegram


Telegram News

Date: |

Unlimited number of subscribers per channel To upload a logo, click the Menu icon and select “Manage Channel.” In a new window, hit the Camera icon. In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. With the sharp downturn in the crypto market, yelling has become a coping mechanism for many crypto traders. This screaming therapy became popular after the surge of Goblintown Ethereum NFTs at the end of May or early June. Here, holders made incoherent groaning sounds in late-night Twitter spaces. They also role-played as urine-loving Goblin creatures. Hui said the time period and nature of some offences “overlapped” and thus their prison terms could be served concurrently. The judge ordered Ng to be jailed for a total of six years and six months.
from us


Telegram 5ec1cff
FROM American