Investigate clientChannels[] out of bounds read/crash
维护者通常 6 天内回复
评估
这个 Issue 还没有评估数据。
描述
Describe the bug
INVALID_INDEX might not be checked everywhere correctly. AI found out that there could be an out of bounds read possiblity in client.cpp if calling SetRemoteChanGain:
To Reproduce
Not tested. Would probably need some server side trigger with invalid Channel ID.
Probably worth checking on the protocol level for invalid IDs.
Ox Alpha (GLM 5.3-Flash) suggested:
Guard the call site (minimal change):
if ( iChanID != INVALID_INDEX && bMuteMeInPersonalMix ) { ... }
and/or reject invalid IDs in EvaluateClientIDMes; optionally add a defensive Q_ASSERT/range check in SetRemoteChanGain/SetRemoteChanPan mirroring OnControllerInFaderLevel (client.cpp:956). Related latent gap: OnControllerInPanValue (client.cpp:965-975) lacks the bounds check its fader sibling has.
Expected behavior
No crash
AI analysis
src/protocol.cpp:1046-1063(EvaluateClientIDMes) — validates only body size (1 byte); the ID value itself (0–255) is passed through unchecked.src/client.cpp:1010-1036(CClient::OnClientIDReceived):
int iChanID = FindClientChannel ( iServerChanID, true ); // should always return channel 0
...
if ( bMuteMeInPersonalMix )
{
SetRemoteChanGain ( iChanID, 0, false ); // iChanID can be INVALID_INDEX (-1)
}
src/client.cpp:1833-1885(FindClientChannel) returnsINVALID_INDEX(-1) wheniServerChannelID < 0 || >= MAX_NUM_CHANNELSor when all 150 client channel slots are occupied.src/client.cpp:506-539(SetRemoteChanGain):&clientChannels[iId]with no bounds check →- timer inactive: OOB write at
client.cpp:535(clientChan->oldGain = clientChan->newGain = fGain;) plus OOB read ofiServerChannelIDfed toChannel.SetRemoteChanGain()(that callee is range-checked,channel.cpp:302); - timer active: OOB write at
client.cpp:522, andminGainOrPanId = -1causesOnTimerRemoteChanGainOrPan(client.cpp:546-548) to iterate from index −1 afterwards.
- timer inactive: OOB write at
clientChannelsis a fixedCClientChannel[150]member array (src/client.h:392).
Contrast with the correct pattern used 700 lines earlier: OnMuteStateHasChangedReceived checks if ( iChanID != INVALID_INDEX ) (client.cpp:340-346).
- 主要语言
- C
- 星标
- 1.1k
- 派生
- 248
- 平均合并
- 11 天 40 分钟
- 30 天内合并 PR
- 6
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
jamulussoftware/jamulus 的其他 Issue
-
Move translation checker (and potentially other runners) to ARM runner可能已有人在做 @ann0see 于 28 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 75/100
jamulussoftware/jamulus#3953 · 2 条评论 ·
维护者通常 6 天内回复
-
AI
难度 2/5 1-3 小时 新手友好度 78/100
jamulussoftware/jamulus#3846 ·
维护者通常 6 天内回复
-
feature request
难度 5/5 一周以上 新手友好度 25/100
jamulussoftware/jamulus#3964 · 3 条评论 ·
维护者通常 6 天内回复
-
难度 3/5 1-2 天 新手友好度 65/100
jamulussoftware/jamulus#3961 ·
维护者通常 6 天内回复
-
难度 3/5 1-2 天 新手友好度 76/100
jamulussoftware/jamulus#3958 ·
维护者通常 6 天内回复
查看 jamulussoftware/jamulus 的全部 Issue
相似的 Issue
-
bug
难度 2/5 1-3 小时 新手友好度 62/100
compiler-explorer/compiler-explorer#9272 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 76/100
semantic-reasoning/wirelog#2163 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
维护者通常 3 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100
Xinyuan-LilyGO/T-Display-S3#352 · 3 条评论 ·
-
documentation severity/minor
难度 1/5 1-3 小时 新手友好度 88/100
维护者通常 1 天内回复