Merge branch 'covscan_fixes' into 'master'
Fix bugs unvelieled by Static Analysis
See merge request gnutls/libtasn1!80
diff --git a/lib/coding.c b/lib/coding.c
index 906b079..5a947a7 100644
--- a/lib/coding.c
+++ b/lib/coding.c
@@ -1098,7 +1098,10 @@
max_len = *len;
if (der == NULL && max_len > 0)
- return ASN1_VALUE_NOT_VALID;
+ {
+ err = ASN1_VALUE_NOT_VALID;
+ goto error;
+ }
counter = 0;
move = DOWN;
diff --git a/lib/element.c b/lib/element.c
index c4e5180..550fdb2 100644
--- a/lib/element.c
+++ b/lib/element.c
@@ -142,7 +142,7 @@
_asn1_append_sequence_set (asn1_node node, struct node_tail_cache_st *pcache)
{
asn1_node p, p2;
- char temp[LTOSTR_MAX_SIZE];
+ char temp[LTOSTR_MAX_SIZE+1];
long n;
if (!node || !(node->down))
diff --git a/src/asn1Coding.c b/src/asn1Coding.c
index 381a1c3..9b54a75 100644
--- a/src/asn1Coding.c
+++ b/src/asn1Coding.c
@@ -72,13 +72,13 @@
int ret;
- ret = fscanf (file, "%s", varName);
+ ret = fscanf (file, "%1023s", varName);
if (ret == EOF)
return ASSIGNMENT_EOF;
if (!strcmp (varName, "''"))
varName[0] = 0;
- ret = fscanf (file, "%s", value);
+ ret = fscanf (file, "%1023s", value);
if (ret == EOF)
return ASSIGNMENT_ERROR;