-
Notifications
You must be signed in to change notification settings - Fork 304
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
HPCC-27310 Fix Coverity scan issue in lnuid #18002
HPCC-27310 Fix Coverity scan issue in lnuid #18002
Conversation
https://track.hpccsystems.com/browse/HPCC-27310 |
7c5f8be
to
8b09b63
Compare
Borrow random_string logic from httplib to populate buffer if /dev/urandom cannot be opened or read. Signed-off-by: Tim Klemm <[email protected]>
8b09b63
to
3f1402e
Compare
@ghalliday I'm not sure who the best person is to review this, but you did diagnose the issue in a Jira comment while posing an important question about how to address it. |
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.
A reasonable fix - even though this should never happen. I would go for a simpler implementation though.
system/globalid/lnuid.cpp
Outdated
OERRLOG("Could not read data from /dev/urandom"); | ||
auto randchar = []() -> char { | ||
const char charset[] = "0123456789" |
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.
simpler is
return (char)rand() ;
there is no need for this to be human readable.
I should have asked you to squash, but too late... |
Jirabot Action Result: |
Borrow random_string logic from httplib to populate buffer if /dev/urandom cannot be opened or read.
Type of change:
Checklist:
Smoketest:
Testing: