-
Notifications
You must be signed in to change notification settings - Fork 57
crypt-(gensalt-)static: Do not overwrite the output buffer too early. #210
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
base: develop
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## develop #210 +/- ##
===========================================
+ Coverage 90.44% 90.46% +0.01%
===========================================
Files 36 36
Lines 3988 3995 +7
Branches 747 749 +2
===========================================
+ Hits 3607 3614 +7
Misses 242 242
Partials 139 139 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Thanks! I agree with the man page edits, but disagree with the code change. Let's not special-case this. There are other related cases to take care of as well: passing the previous return value as |
To be clear, I do not mean to also special-case those other cases - rather, to develop a generic fix for all of these that would not need to check any conditions. Just don't overwrite the output buffer before reading both inputs, ever. |
5ce25b7
to
88965a3
Compare
Should be addressed properly in the rebased commit. |
88965a3
to
a086c71
Compare
bafeb9e
to
b1230ad
Compare
Allow passing a pointer returned by crypt(3) previously as the input for a subsequent call to crypt(3), adapt the manpage accordingly, and implement a simple testcase for such a scenario. Also apply the same semantics to crypt_gensalt(3). Fixes #209.
b1230ad
to
962ad88
Compare
@solardiz Is everything okay with the changes now? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes look OK to me now. However, I am concerned about a few related things (I'll write a separate comment).
I'm sorry it took me a while to get to reviewing this again. It's hard for me to make time when I can concentrate on critical code reviews now. I'm concerned that we're adding complexity to paper over prior code's shortcomings, but OTOH I understand that we care not only about risk of bugs in latest code, but about risk of bugs across all versions, and more code changes mean increasing the latter risk. That's an unfortunate tradeoff. For brand new code, we'd probably postpone the Please don't make any changes to address this comment yet. Let's discuss first, along with the additional concern I just brought up in #209. Maybe @ldv-alt would want to weigh in? |
Allow passing a pointer returned by crypt(3) previously as the input for a subsequent call to crypt(3), adapt the manpage accordingly, and implement a simple testcase for such a scenario.
Also apply the same semantics to crypt_gensalt(3).
Fixes #209.