Fixing CID 280433 and 280357.

Also strengthening the checking and debug presentation.

svn path=/trunk/; revision=47060
This commit is contained in:
Jaap Keuter 2013-01-14 07:43:14 +00:00
parent 165f86b9a3
commit 23d2320dd0
1 changed files with 4 additions and 8 deletions

View File

@ -849,31 +849,27 @@ const char* oid_subid2string(guint32* subids, guint len) {
static guint check_num_oid(const char* str) {
const char* r = str;
char c = '\0';
char c = '.';
guint n = 0;
D(8,("check_num_oid: '%s'",str));
if (!r || *r == '.' || *r == '\0') return 0;
if (!r) return 0;
do {
D(9,("\tcheck_num_oid: '%c' %d",*r,n));
switch(*r) {
case '.':
case '.': case '\0':
n++;
if (c == '.') return 0;
break;
case '1' : case '2' : case '3' : case '4' : case '5' :
case '6' : case '7' : case '8' : case '9' : case '0' :
continue;
case '\0':
n++;
break;
default:
return 0;
}
} while((c = *r++));
if (c == '.') return 0;
return n;
}