Skip to content

[QM] Fixed overflow runtime error#8924

Open
6CRIPT wants to merge 1 commit into
mainfrom
bugs/620337-Missing-Overflow-Protection-in-Sample-Size-Calculation
Open

[QM] Fixed overflow runtime error#8924
6CRIPT wants to merge 1 commit into
mainfrom
bugs/620337-Missing-Overflow-Protection-in-Sample-Size-Calculation

Conversation

@6CRIPT

@6CRIPT 6CRIPT commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#620337

Also test added

@6CRIPT 6CRIPT requested a review from a team June 30, 2026 12:23
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jun 30, 2026
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 30, 2026
@6CRIPT 6CRIPT requested a review from Copilot June 30, 2026 12:27
@6CRIPT 6CRIPT self-assigned this Jun 30, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

Fixes an overflow runtime error in Quality Management when calculating Sample Size from Percent of Quantity for very large Source Quantity (Base) values, and adds a regression test to ensure the value is clamped rather than crashing.

Changes:

  • Clamp the percent-based sample size calculation to the maximum Integer value before validating into the "Sample Size" field.
  • Add a test that reproduces the overflow scenario using a source quantity greater than Integer max.
  • Add a test-library helper to create an inspection + template configured for percent-based sampling and return the resulting sample size.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.

File Description
src/Apps/W1/Quality Management/test/src/QltyTestsMisc.Codeunit.al Adds a regression test verifying sample size clamping for very large source quantities.
src/Apps/W1/Quality Management/Test Library/src/QltyInspectionUtility.Codeunit.al Adds a test helper to set up percent-of-quantity sampling and return the computed sample size.
src/Apps/W1/Quality Management/app/src/Document/QltyInspectionHeader.Table.al Prevents overflow by clamping the percent-based calculated sample size before validating into an Integer field.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@github-actions

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 1 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants