Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: prevent possible overflow #1863

Merged
merged 2 commits into from
Jun 16, 2022
Merged

fix: prevent possible overflow #1863

merged 2 commits into from
Jun 16, 2022

Conversation

armcknight
Copy link
Member

@codecov-commenter
Copy link

codecov-commenter commented Jun 4, 2022

Codecov Report

Merging #1863 (593efe2) into master (4ec83c3) will increase coverage by 0.03%.
The diff coverage is n/a.

❗ Current head 593efe2 differs from pull request most recent head b3bf28d. Consider uploading reports for the commit b3bf28d to get more accurate results

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1863      +/-   ##
==========================================
+ Coverage   92.32%   92.35%   +0.03%     
==========================================
  Files         200      200              
  Lines        9390     9390              
==========================================
+ Hits         8669     8672       +3     
+ Misses        721      718       -3     
Impacted Files Coverage Δ
Sources/Sentry/include/SentryProfilingLogging.hpp 61.90% <0.00%> (-4.77%) ⬇️
Sources/Sentry/SentryProfilingLogging.mm 67.85% <0.00%> (-3.58%) ⬇️
Sources/Sentry/SentryThreadHandle.cpp 73.20% <0.00%> (-1.31%) ⬇️
Sources/Sentry/SentryBacktrace.cpp 96.09% <0.00%> (+1.56%) ⬆️
Sources/Sentry/SentryProfiler.mm 94.21% <0.00%> (+1.57%) ⬆️
Sources/Sentry/include/SentryAsyncSafeLogging.h 100.00% <0.00%> (+100.00%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4ec83c3...b3bf28d. Read the comment docs.

@armcknight armcknight marked this pull request as ready for review June 4, 2022 20:49
@@ -1122,7 +1122,8 @@ sentrycrashobjc_ivarValue(const void *const objectPtr, int ivarIndex, void *dst)
return false;
}
uintptr_t ivarPtr = (uintptr_t)&ivars->first;
const struct ivar_t *ivar = (void *)(ivarPtr + ivars->entsizeAndFlags * (unsigned)ivarIndex);
const struct ivar_t *ivar
Copy link
Member

Choose a reason for hiding this comment

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

m: Can we add a test for that in SentryCrashObjC_Tests please?

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm not sure how to construct a test case that would force the overflow condition. Did you have something in mind?

Copy link
Member

Choose a reason for hiding this comment

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

Nope, now idea how to do this.

@armcknight
Copy link
Member Author

armcknight commented Jun 10, 2022

Opened a PR upstream: kstenerud/KSCrash#430. Will give maintainers there a while to comment before moving forward with this one, in case they point out anything we'd want to include here.

@philipphofmann
Copy link
Member

Will give maintainers there a while to comment before moving forward with this

It can be that it takes months until you get feedback @armcknight. I opened a simple PR on the first of April and didn't get any feedback yet, see kstenerud/KSCrash#427.

@brustolin
Copy link
Contributor

brustolin commented Jun 13, 2022

Will give maintainers there a while to comment before moving forward with this

It can be that it takes months until you get feedback @armcknight. I opened a simple PR on the first of April and didn't get any feedback yet, see kstenerud/KSCrash#427.

My issue is open since February kstenerud/KSCrash#423 😂

@philipphofmann
Copy link
Member

We can also ask @Swatinem to have a look at this tiny change. @Swatinem, do you think this makes sense?

@armcknight armcknight merged commit 627000e into master Jun 16, 2022
@armcknight armcknight deleted the armcknight/codescan-fix branch June 16, 2022 16:20
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.

None yet

6 participants