Skip to content

Conversation

@fredroy
Copy link
Contributor

@fredroy fredroy commented Jan 29, 2026

Different overflows risk were not checked,
and one array access is a bug (in BaseContactMapper)

[with-all-tests]


By submitting this pull request, I acknowledge that
I have read, understand, and agree SOFA Developer Certificate of Origin (DCO).


Reviewers will merge this pull-request only if

  • it builds with SUCCESS for all platforms on the CI.
  • it does not generate new warnings.
  • it does not generate new unit test failures.
  • it does not generate new scene test failures.
  • it does not break API compatibility.
  • it is more than 1 week old (or has fast-merge label).

@fredroy fredroy added pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request pr: ai-generated Label notifying the reviewers that part or all of the PR has been generated with the help of an AI labels Jan 29, 2026
…reading and writing same buffer).

  Fixed:
  sscanf(buf, "%*127s %127s", matName);

  Breaking down the format:
  - %*127s - The * is the assignment suppression modifier. It means "read up to 127 chars but discard them (don't store)". This skips the first word (like "newmtl")
  - %127s - Read the second word (the material name), limited to 127 chars, store in matName

  So if buf contains "newmtl MyMaterial\n":
  - %*127s reads and discards "newmtl"
  - %127s reads "MyMaterial" into matName

  The 127 limit prevents buffer overflow since matName is 128 bytes (127 chars + null terminator).
… buffer overflows from size calculation wraparound
@fredroy fredroy force-pushed the fix_vulnerabilities_overflows branch from cbcd999 to e942da9 Compare January 29, 2026 03:53
@fredroy
Copy link
Contributor Author

fredroy commented Jan 29, 2026

[ci-build][with-all-tests]

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

Labels

pr: ai-generated Label notifying the reviewers that part or all of the PR has been generated with the help of an AI pr: fix Fix a bug pr: status to review To notify reviewers to review this pull-request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant