cloudwu / cloudwu/sproto

encode buffer overflow

Open
#75 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
982
Forks
254
PR merge metrics
No merged PRs in 30d

Description

Assertion failed: (sz <= size-SIZEOF_LENGTH), function encode_object, file lualib-src/sproto/sproto.c, line 733.

如果先 encode 其它的,在 encode 这个有问题的就没问题。怀疑 expand_buffer 没起作用,可能是 data 刚好写满触发了哪里的临界条件。

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in lualib-src/sproto/sproto.c at encode_object, line 733, and inspect how expand_buffer behaves when data exactly fills the buffer. Reproduce the failure by encoding the reported message first, then compare it with encoding another message beforehand. Done means the assertion no longer occurs in the direct encoding sequence.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
networking
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.