projects
/
platform
/
upstream
/
libtasn1.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
4f3b626
)
more efficient check for '?LAST' and error checking.
author
Nikos Mavrogiannopoulos
<nmav@redhat.com>
Tue, 3 Jun 2014 14:35:45 +0000
(16:35 +0200)
committer
Nikos Mavrogiannopoulos
<nmav@redhat.com>
Wed, 4 Jun 2014 08:06:53 +0000
(10:06 +0200)
lib/parser_aux.c
patch
|
blob
|
history
diff --git
a/lib/parser_aux.c
b/lib/parser_aux.c
index
effedb2
..
39e4046
100644
(file)
--- a/
lib/parser_aux.c
+++ b/
lib/parser_aux.c
@@
-170,13
+170,13
@@
asn1_find_node (asn1_node pointer, const char *name)
return NULL;
p = p->down;
+ if (p == NULL)
+ return NULL;
/* The identifier "?LAST" indicates the last element
in the right chain. */
- if (
!strcmp (n, "?LAST"))
+ if (
n[0] == '?' && n[1] == 'L') /* ?LAST */
{
- if (p == NULL)
- return NULL;
while (p->right)
p = p->right;
}
@@
-189,9
+189,9
@@
asn1_find_node (asn1_node pointer, const char *name)
else
p = p->right;
}
- if (p == NULL)
- return NULL;
}
+ if (p == NULL)
+ return NULL;
} /* while */
return p;