diff options
author | Andrew Bartlett <abartlet@samba.org> | 2009-08-05 11:25:50 +1000 |
---|---|---|
committer | Andrew Bartlett <abartlet@samba.org> | 2009-08-05 12:18:17 +1000 |
commit | cd1d7f4be7d31388ab79c797acaf6d7730113112 (patch) | |
tree | 3d25e28089d1cffa5d7dadca529e29b936681607 /source4/heimdal/lib/asn1/der_get.c | |
parent | 8bba340e65e84ee09a7da4d97bc7838d3eefbb15 (diff) | |
download | samba-cd1d7f4be7d31388ab79c797acaf6d7730113112.tar.gz samba-cd1d7f4be7d31388ab79c797acaf6d7730113112.tar.bz2 samba-cd1d7f4be7d31388ab79c797acaf6d7730113112.zip |
s4:heimdal: import lorikeet-heimdal-200908050050 (commit 8714779fa7376fd9f7761587639e68b48afc8c9c)
This also adds a new hdb-glue.c file, to cope with Heimdal's
uncondtional enabling of SQLITE.
(Very reasonable, but not required for Samba4's use).
Andrew Bartlett
Diffstat (limited to 'source4/heimdal/lib/asn1/der_get.c')
-rw-r--r-- | source4/heimdal/lib/asn1/der_get.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/heimdal/lib/asn1/der_get.c b/source4/heimdal/lib/asn1/der_get.c index 8144639b9a..aee565040f 100644 --- a/source4/heimdal/lib/asn1/der_get.c +++ b/source4/heimdal/lib/asn1/der_get.c @@ -198,6 +198,13 @@ der_get_bmp_string (const unsigned char *p, size_t len, for (i = 0; i < data->length; i++) { data->data[i] = (p[0] << 8) | p[1]; p += 2; + /* check for NUL in the middle of the string */ + if (data->data[i] == 0 && i != (data->length - 1)) { + free(data->data); + data->data = NULL; + data->length = 0; + return ASN1_BAD_CHARACTER; + } } if (size) *size = len; @@ -222,6 +229,13 @@ der_get_universal_string (const unsigned char *p, size_t len, for (i = 0; i < data->length; i++) { data->data[i] = (p[0] << 24) | (p[1] << 16) | (p[2] << 8) | p[3]; p += 4; + /* check for NUL in the middle of the string */ + if (data->data[i] == 0 && i != (data->length - 1)) { + free(data->data); + data->data = NULL; + data->length = 0; + return ASN1_BAD_CHARACTER; + } } if (size) *size = len; return 0; |