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:
960d3db
)
asn1_write_value: fix segfault when deleting an unauthorized element
author
Jean-Louis Thekekara
<jean-louis.thekekara@openwide.fr>
Tue, 25 Mar 2014 16:15:58 +0000
(17:15 +0100)
committer
Nikos Mavrogiannopoulos
<nmav@redhat.com>
Fri, 28 Mar 2014 13:49:03 +0000
(14:49 +0100)
Segfaults can occur, since value is dereferenced later, ex:
352 if ((isdigit (value[0])) || (value[0] == '-')
Signed-off-by: Nikos Mavrogiannopoulos <nmav@redhat.com>
lib/element.c
patch
|
blob
|
history
diff --git
a/lib/element.c
b/lib/element.c
index
3e26d84
..
ee77feb
100644
(file)
--- a/
lib/element.c
+++ b/
lib/element.c
@@
-303,6
+303,12
@@
asn1_write_value (asn1_node node_root, const char *name,
return ASN1_SUCCESS;
}
+ /* Don't allow element deletion for other types */
+ if (value == NULL)
+ {
+ return ASN1_VALUE_NOT_VALID;
+ }
+
switch (type)
{
case ASN1_ETYPE_BOOLEAN: