Skip to content

Pull request for issue #15#18

Closed
google-labs-jules[bot] wants to merge 4 commits intomasterfrom
fix-cran-issue
Closed

Pull request for issue #15#18
google-labs-jules[bot] wants to merge 4 commits intomasterfrom
fix-cran-issue

Conversation

@google-labs-jules
Copy link
Copy Markdown

Fixes #15

A buffer overflow was reported by CRAN's sanitizers in the `construct`
function in `src/blast.c`. The `rep` pointer could read past the end of the
buffer, causing a crash.

This commit adds a safeguard to the `construct` function to prevent the
`symbol` index from exceeding the bounds of the `length` array. This is
done by adding a check to the inner `do-while` loop and modifying the
outer loop's condition to ensure the index stays within the valid range.
@danicat danicat marked this pull request as ready for review July 14, 2025 22:23
A buffer overflow was reported by CRAN's sanitizers in the `construct`
function in `src/blast.c`. The `rep` pointer could read past the end of the
buffer, causing a crash.

This commit adds a safeguard to the `construct` function to prevent the
`symbol` index from exceeding the bounds of the `length` array. This is
done by adding a check to the inner `do-while` loop and modifying the
outer loop's condition to ensure the index stays within the valid range.

A new job has been added to the GitHub Actions workflow to run the R CMD
check with the address sanitizer enabled. This will help to catch similar
issues in the future.
A buffer overflow was reported by CRAN's sanitizers in the `construct`
function in `src/blast.c`. The `rep` pointer could read past the end of the
buffer, causing a crash.

This commit adds a safeguard to the `construct` function to prevent the
`symbol` index from exceeding the bounds of the `length` array. This is
done by adding a check to the inner `do-while` loop and modifying the
outer loop's condition to ensure the index stays within the valid range.

A new job has been added to the GitHub Actions workflow to run the R CMD
check with the address sanitizer enabled. This will help to catch similar
issues in the future. Leak detection has been enabled by default.
@danicat danicat marked this pull request as draft July 14, 2025 22:31
A buffer overflow was reported by CRAN's sanitizers in the `construct`
function in `src/blast.c`. The `rep` pointer could read past the end of the
buffer, causing a crash.

This commit adds a safeguard to the `construct` function to prevent the
`symbol` index from exceeding the bounds of the `length` array. This is
done by adding a check to the inner `do-while` loop and modifying the
outer loop's condition to ensure the index stays within the valid range.
@danicat danicat closed this Jul 15, 2025
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.

Impeding CRAN archival on 2024-07-06

1 participant