(file) Return to CIMObjectPath.cpp CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Common

Diff for /pegasus/src/Pegasus/Common/CIMObjectPath.cpp between version 1.51 and 1.52

version 1.51, 2005/05/20 08:58:48 version 1.52, 2005/06/01 01:51:53
Line 468 
Line 468 
  
         Boolean isValid = false;         Boolean isValid = false;
  
         if (isdigit(hostname[0]))          if (isascii(hostname[0]) && isdigit(hostname[0]))
         {         {
             //--------------------------------------------------------------             //--------------------------------------------------------------
             // Attempt to validate an IP address, but keep in mind that it             // Attempt to validate an IP address, but keep in mind that it
Line 485 
Line 485 
                 // If a non-digit is encountered in the input parameter,                 // If a non-digit is encountered in the input parameter,
                 // then break from here and attempt to validate as host name.                 // then break from here and attempt to validate as host name.
                 //----------------------------------------------------------                 //----------------------------------------------------------
                 if (!isdigit(hostname[i]))                  if (!(isascii(hostname[i]) && isdigit(hostname[i])))
                 {                 {
                     isValid = false;                     isValid = false;
                     break;                     break;
                 }                 }
  
                 while (isdigit(hostname[i]))  // skip over digits                  // skip over digits
                   while (isascii(hostname[i]) && isdigit(hostname[i]))
                 {                 {
                     octetValue = octetValue*10 + (hostname[i] - '0');                     octetValue = octetValue*10 + (hostname[i] - '0');
                     i++;                     i++;
Line 534 
Line 535 
                 expectHostSegment = false;                 expectHostSegment = false;
                 hostSegmentIsNumeric = true; // assume all-numeric host segment                 hostSegmentIsNumeric = true; // assume all-numeric host segment
  
                 if (!isalnum(hostname[i]))                  if (!(isascii(hostname[i]) && isalnum(hostname[i])))
                 {                 {
                     return false;                     return false;
                 }                 }
  
                 while (isalnum(hostname[i]) || (hostname[i] == '-') ||                  while (isascii(hostname[i]) &&
                                                (hostname[i] == '_'))                         (isalnum(hostname[i]) || (hostname[i] == '-') ||
                           (hostname[i] == '_')))
                 {                 {
                     // If a non-digit is encountered, set "all-numeric"                     // If a non-digit is encountered, set "all-numeric"
                     // flag to false                     // flag to false
Line 573 
Line 575 
  
         if (hostname[i] == ':')         if (hostname[i] == ':')
         {         {
             if (!isdigit(hostname[++i]))              i++;
               if (!(isascii(hostname[i]) && isdigit(hostname[i])))
             {             {
                 return false;                 return false;
             }             }
               i++;
  
             while (isdigit(hostname[++i]));              while (isascii(hostname[i]) && isdigit(hostname[i]))
               {
                   i++;
               }
         }         }
  
         return (hostname[i] == char(0));         return (hostname[i] == char(0));


Legend:
Removed from v.1.51  
changed lines
  Added in v.1.52

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2