mirror of
https://github.com/linux-apfs/apfstests.git
synced 2026-05-01 15:01:44 -07:00
Fix atohan to verify a valid hex string is being used for a handle.
atohan needs to verify that the string being passed in is actually a valid hex string before it assumes that it's a file handle rather than a file name. PV 951244
This commit is contained in:
@@ -181,6 +181,9 @@ atohan(
|
||||
if (i == HANDLE_LEN){
|
||||
return(EBADF);
|
||||
}
|
||||
if( ! (isxdigit(*handle_str) && (isxdigit(*(handle_str +1))))) {
|
||||
return(EBADF);
|
||||
}
|
||||
cur_char[0] = *handle_str;
|
||||
cur_char[1] = *(handle_str + 1);
|
||||
cur_char[2] = '\0';
|
||||
|
||||
Reference in New Issue
Block a user