Skip to content

Decode negative HTTP body integers consistently - #853

Merged
chrisgleissner merged 3 commits into
GideonZ:masterfrom
barryw:fix/315-http-signed-integers
Sep 14, 2026
Merged

chrisgleissner merged 3 commits into
GideonZ:masterfrom
barryw:fix/315-http-signed-integers

Conversation

@barryw

@barryw barryw commented Sep 4, 2026

Copy link
Copy Markdown
Contributor

Negative one-, two- and three-byte HTTP body integers decode as positive when plain char is unsigned. Use int8_t for the sign byte and multiplication instead of shifting a negative signed value.

Introduced after 3.14 with the HTTP target. Tests cover zero, maximum positive, minimum negative and -1 at all four wire widths. Tested independently against test-merge at 8596576f, in the upstream pipeline’s my_docker_image (host G++ 13.3.0):

make -B -C target/pc/linux/test_http_target test-integer-widths

Same tests with unsigned char, changing only the firmware fix:

Before: Integer widths: 99 checks, 6 failures; exit 2
After:  Integer widths: 99 checks, 0 failures; exit 0

Red/green evidence; final CI build passed all five firmware targets and the application-space gate. Hardware E2E was not run.

@chrisgleissner

chrisgleissner commented Sep 5, 2026

Copy link
Copy Markdown
Collaborator

@barryw Thanks for spotting this.

Could you please analyze which actual user facing features are degraded by this bug so we can triage it for 3.15?

@barryw

barryw commented Sep 5, 2026

Copy link
Copy Markdown
Contributor Author

@chrisgleissner I think this is a 3.16 bug. I just don't like leaving broken code lying around. We can leave it until after 3.15 ships.

@chrisgleissner chrisgleissner added 3.16 Targets 3.16 release bug labels Sep 9, 2026
@chrisgleissner
chrisgleissner changed the base branch from test-merge to master September 13, 2026 12:42
@chrisgleissner chrisgleissner added 3.15 and removed 3.16 Targets 3.16 release labels Sep 14, 2026
@chrisgleissner
chrisgleissner merged commit 7606801 into GideonZ:master Sep 14, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants