mirror of
https://github.com/topjohnwu/selinux.git
synced 2025-02-24 05:13:36 +00:00
Clear errno before call to strtol(3).
Since strtol(3) doesn't clear errno on success, anything that sets errno prior to this call will make it look like the call failed. This happens when built with ASAN. Signed-off-by: Dan Albert <danalbert@google.com> Acked-by: Steve Lawrence <slawrence@tresys.com>
This commit is contained in:
parent
823ebc8c6b
commit
b1bbd3030b
@ -456,7 +456,9 @@ int main(int argc, char **argv)
|
||||
mlspol = 1;
|
||||
break;
|
||||
case 'c':{
|
||||
long int n = strtol(optarg, NULL, 10);
|
||||
long int n;
|
||||
errno = 0;
|
||||
n = strtol(optarg, NULL, 10);
|
||||
if (errno) {
|
||||
fprintf(stderr,
|
||||
"Invalid policyvers specified: %s\n",
|
||||
|
Loading…
x
Reference in New Issue
Block a user