Skip to content

fix(vtl): narrow template numbers through int32 after the range check - #1643

Merged
NitinKumar004 merged 1 commit into
developmentfrom
fix/vtl-codeql-int32
Oct 15, 2026
Merged

NitinKumar004 merged 1 commit into
developmentfrom
fix/vtl-codeql-int32

Conversation

@NitinKumar004

Copy link
Copy Markdown
Collaborator

CodeQL alert #95 (incorrect conversion between integer types, internal/vtl/eval.go:700) is still open on development and fails the CodeQL check on the v2.14.0 release PR (#1640).

toInt already rejects anything outside the int32 range (and NaN) before converting, so the value always fits. CodeQL doesn't treat that range check as a guard for a conversion to the platform-sized int, so both branches now convert through int32 explicitly: int(int32(t)). Behaviour is unchanged: in-range values convert the same way, fractions still truncate toward zero, and out-of-range values are still refused.

Tested with go test -race on internal/vtl and server/aws/apigateway.

@NitinKumar004
NitinKumar004 merged commit 6992346 into development Oct 15, 2026
21 checks passed
@NitinKumar004
NitinKumar004 deleted the fix/vtl-codeql-int32 branch October 15, 2026 07:42
Comment thread internal/vtl/eval.go
}

return int(t), true
return int(int32(t)), true
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.

2 participants