projects
/
xfstests-dev.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
43a1150
)
Fix atohan to verify a valid hex string is being used for a handle.
author
Bob Kierski
<bobo@sgi.com>
Thu, 23 Mar 2006 15:45:54 +0000
(15:45 +0000)
committer
Bob Kierski
<bobo@sgi.com>
Thu, 23 Mar 2006 15:45:54 +0000
(15:45 +0000)
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
dmapi/src/common/lib/util.c
patch
|
blob
|
history
diff --git
a/dmapi/src/common/lib/util.c
b/dmapi/src/common/lib/util.c
index f6bedb085d5302a949ae949b854b43cba470e494..0160b384cbfde4f84f74a5968504f2ce11776539 100644
(file)
--- a/
dmapi/src/common/lib/util.c
+++ b/
dmapi/src/common/lib/util.c
@@
-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';