version 1.92, 2003/10/16 23:25:03
|
version 1.93, 2003/10/17 21:00:45
|
|
|
return true; | return true; |
} | } |
| |
static inline Uint8 _hexCharToNumeric(const char c) |
inline Uint8 _xmlReader_hexCharToNumeric(const char c) |
{ | { |
Uint8 n; | Uint8 n; |
| |
|
|
| |
} | } |
| |
Uint8 digit1 = _hexCharToNumeric(char(uriString[++i])); |
Uint8 digit1 = _xmlReader_hexCharToNumeric(char(uriString[++i])); |
Uint8 digit2 = _hexCharToNumeric(char(uriString[++i])); |
Uint8 digit2 = _xmlReader_hexCharToNumeric(char(uriString[++i])); |
if ( (digit1 > 15) || (digit2 > 15) ) | if ( (digit1 > 15) || (digit2 > 15) ) |
{ | { |
// l10n | // l10n |
|
|
x = x << 4; | x = x << 4; |
| |
// Make sure we don't overflow when we add the next digit | // Make sure we don't overflow when we add the next digit |
Sint64 newDigit = Sint64(_hexCharToNumeric(*p++)); |
Sint64 newDigit = Sint64(_xmlReader_hexCharToNumeric(*p++)); |
if (PEGASUS_SINT64_MIN - x > -newDigit) | if (PEGASUS_SINT64_MIN - x > -newDigit) |
{ | { |
return false; | return false; |
|
|
x = x << 4; | x = x << 4; |
| |
// We can't overflow when we add the next digit | // We can't overflow when we add the next digit |
Uint64 newDigit = Uint64(_hexCharToNumeric(*p++)); |
Uint64 newDigit = Uint64(_xmlReader_hexCharToNumeric(*p++)); |
if (PEGASUS_UINT64_MAX - x < newDigit) | if (PEGASUS_UINT64_MAX - x < newDigit) |
{ | { |
return false; | return false; |
|
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |
|
|