-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8333871: Check return values of sysinfo #28317
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
Changes from 5 commits
2d574f7
e9d2b1b
6284ef2
2f4c7c9
e498891
22a2f6a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -388,8 +388,12 @@ GetJavaProperties(JNIEnv *env) | |||||
| /* supported instruction sets */ | ||||||
| { | ||||||
| char list[258]; | ||||||
| sysinfo(SI_ISALIST, list, sizeof(list)); | ||||||
| sprops.cpu_isalist = strdup(list); | ||||||
| int ret = sysinfo(SI_ISALIST, list, sizeof(list)); | ||||||
| if (ret == 0) { | ||||||
| sprops.cpu_isalist = strdup(list); | ||||||
| } else { | ||||||
| sprops.cpu_isalist = NULL; | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would you mind checking the code that puts this in a system property can tolerate NULL? I don't suppose sysinfo will fail here (unless you found a case?) but it would be good to confirm that it won't blow up somewhere else.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We do PUTPROP here
with 3rd parameter == NULL in this case. PUTPROP checks for this so I do not see issues with this
|
||||||
| } | ||||||
| } | ||||||
| #else | ||||||
| sprops.cpu_isalist = NULL; | ||||||
|
|
||||||
Uh oh!
There was an error while loading. Please reload this page.