Skip to content

Conversation

@lgritz
Copy link
Collaborator

@lgritz lgritz commented May 3, 2025

I think what we were doing here was fine all along, but the idiom was confusing to static analyzers who identified a danger that we were memcpy'ing into a field that was potentially not big enough. A minor restructuring of the code and a new assertion should verify that it's safe and also make it clear to the static analyzer that we aren't falling into the case it warned about.

I think what we were doing here was fine all along, but the idiom was
confusing to static analyzers who identified a danger that we were
memcpy'ing into a field that was potentially not big enough. A minor
restructuring of the code and a new assertion should verify that it's
safe and also make it clear to the static analyzer that we aren't
falling into the case it warned about.

Signed-off-by: Larry Gritz <[email protected]>
@lgritz lgritz added the internals Internal changes, not public APIs label May 3, 2025
@lgritz lgritz requested a review from scott-wilson May 3, 2025 22:22
@scott-wilson
Copy link
Contributor

Looks good to me. Did a test compile, and it compiled without issues.

@lgritz lgritz merged commit ff8d777 into AcademySoftwareFoundation:main May 4, 2025
27 checks passed
@lgritz lgritz deleted the lg-atde branch May 5, 2025 05:14
lgritz added a commit to lgritz/OpenImageIO that referenced this pull request May 7, 2025
…ftwareFoundation#4737)

I think what we were doing here was fine all along, but the idiom was
confusing to static analyzers who identified a danger that we were
memcpy'ing into a field that was potentially not big enough. A minor
restructuring of the code and a new assertion should verify that it's
safe and also make it clear to the static analyzer that we aren't
falling into the case it warned about.

Signed-off-by: Larry Gritz <[email protected]>
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 17, 2025
…ftwareFoundation#4737)

I think what we were doing here was fine all along, but the idiom was
confusing to static analyzers who identified a danger that we were
memcpy'ing into a field that was potentially not big enough. A minor
restructuring of the code and a new assertion should verify that it's
safe and also make it clear to the static analyzer that we aren't
falling into the case it warned about.

Signed-off-by: Larry Gritz <[email protected]>
Signed-off-by: Scott Wilson <[email protected]>
scott-wilson pushed a commit to scott-wilson/OpenImageIO that referenced this pull request May 18, 2025
…ftwareFoundation#4737)

I think what we were doing here was fine all along, but the idiom was
confusing to static analyzers who identified a danger that we were
memcpy'ing into a field that was potentially not big enough. A minor
restructuring of the code and a new assertion should verify that it's
safe and also make it clear to the static analyzer that we aren't
falling into the case it warned about.

Signed-off-by: Larry Gritz <[email protected]>
Signed-off-by: Scott Wilson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

internals Internal changes, not public APIs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants