From e664e8508a41ee367fe41c8fc875a2525a720c70 Mon Sep 17 00:00:00 2001 From: Bob Kierski Date: Thu, 23 Mar 2006 15:45:54 +0000 Subject: [PATCH] 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 --- dmapi/src/common/lib/util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/dmapi/src/common/lib/util.c b/dmapi/src/common/lib/util.c index f6bedb08..0160b384 100644 --- 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'; -- 2.39.5