Stub-generator now generates alloc statements for tagless ANY
OPTIONAL, remove workaround. git-svn-id: svn://svn.h5l.se/heimdal/trunk/heimdal@16672 ec53bebd-3082-4978-b11e-865c3cabbd6b
This commit is contained in:
@@ -59,10 +59,7 @@ decode_heim_any(const unsigned char *p, size_t len,
|
|||||||
unsigned int thistag;
|
unsigned int thistag;
|
||||||
int e;
|
int e;
|
||||||
|
|
||||||
if (data == NULL && len == 0) { /* XXX tag less OPTIONAL */
|
memset(data, 0, sizeof(*data));
|
||||||
*size = 0;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
e = der_get_tag (p, len, &thisclass, &thistype, &thistag, &l);
|
e = der_get_tag (p, len, &thisclass, &thistype, &thistag, &l);
|
||||||
if (e) return e;
|
if (e) return e;
|
||||||
@@ -73,16 +70,15 @@ decode_heim_any(const unsigned char *p, size_t len,
|
|||||||
if (length + len_len + l > len)
|
if (length + len_len + l > len)
|
||||||
return ASN1_OVERFLOW;
|
return ASN1_OVERFLOW;
|
||||||
|
|
||||||
if (data) { /* XXX hack to workaround tag less OPTIONAL data */
|
data->data = malloc(length + len_len + l);
|
||||||
memset(data, 0, sizeof(*data));
|
if (data->data == NULL)
|
||||||
|
return ENOMEM;
|
||||||
data->data = malloc(length + len_len + l);
|
data->length = length + len_len + l;
|
||||||
if (data->data == NULL)
|
memcpy(data->data, p, length + len_len + l);
|
||||||
return ENOMEM;
|
|
||||||
data->length = length + len_len + l;
|
if (size)
|
||||||
memcpy(data->data, p, length + len_len + l);
|
*size = length + len_len + l;
|
||||||
}
|
|
||||||
if (size) *size = length + len_len + l;
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user