Skip to content

fix(sms): reject oversized binding inputs - #344

Merged
nijel merged 1 commit into
masterfrom
pdu
Aug 19, 2026
Merged

fix(sms): reject oversized binding inputs#344
nijel merged 1 commit into
masterfrom
pdu

Conversation

@nijel

@nijel nijel commented Aug 19, 2026

Copy link
Copy Markdown
Member

Prevent Python callers from silently truncating attacker-controlled SMS data at fixed C limits. Propagate core encoding failures and clean up intermediate allocations on error.

@nijel nijel self-assigned this Aug 19, 2026

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 48b4c6b74c

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread gammu/src/gammu.c
Comment on lines +5837 to +5838
error = GSM_EncodeMultiPartSMS(GSM_GetGlobalDebug(), &smsinfo, &smsout);
if (!checkError(error, "EncodeMultiPartSMS")) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Preserve the encoder's boolean return contract

With the Gammu 1.44.0 API used by the inspected workflows, GSM_EncodeMultiPartSMS returns gboolean, not GSM_Error, so assigning its result to error cannot propagate a specific encoding failure. A rejected oversized multipart input returns FALSE (0), which checkError converts to the generic GammuError rather than ERR_INVALIDDATA; consequently the newly added pytest.raises(gammu.ERR_INVALIDDATA) case fails, while successful calls only work accidentally because TRUE has the same numeric value as ERR_NONE.

Useful? React with 👍 / 👎.

Prevent Python callers from silently truncating attacker-controlled SMS data at fixed C limits. Propagate core encoding failures and clean up intermediate allocations on error.
@nijel
nijel enabled auto-merge (rebase) August 19, 2026 11:10
@nijel
nijel merged commit 0f9a65f into master Aug 19, 2026
48 checks passed
@nijel
nijel deleted the pdu branch August 19, 2026 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant