]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
lib: Avoid ZERO_STRUCT with {} plus calling asn1_load_nocopy
authorVolker Lendecke <vl@samba.org>
Wed, 1 Jul 2026 11:01:37 +0000 (13:01 +0200)
committerAnoop C S <anoopcs@samba.org>
Fri, 3 Jul 2026 04:47:29 +0000 (04:47 +0000)
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Anoop C S <anoopcs@samba.org>
lib/util/asn1.c

index 51fae4e3239df4075acea18a44ae25d30131cc62..b6a54a09509690678a52db233c1fe9b0f2b197bc 100644 (file)
@@ -1154,13 +1154,11 @@ void asn1_load_nocopy(struct asn1_data *data, uint8_t *buf, size_t len)
 
 int asn1_peek_full_tag(DATA_BLOB blob, uint8_t tag, size_t *packet_size)
 {
-       struct asn1_data asn1;
+       struct asn1_data asn1 = {};
        size_t size;
        bool ok;
 
-       ZERO_STRUCT(asn1);
-       asn1.data = blob.data;
-       asn1.length = blob.length;
+       asn1_load_nocopy(&asn1, blob.data, blob.length);
 
        ok = asn1_peek_tag_needed_size(&asn1, tag, &size);
        if (!ok) {