From 00c658e7356a76ce42a6f87272ff4bacf1a72539 Mon Sep 17 00:00:00 2001 From: Volker Birk Date: Tue, 10 Aug 2021 18:39:55 +0200 Subject: [PATCH] support disabling max_blob_size --- src/map_asn1.c | 8 ++++++++ src/map_asn1.h | 4 ++++ 2 files changed, 12 insertions(+) diff --git a/src/map_asn1.c b/src/map_asn1.c index 57e807fa..02306c23 100644 --- a/src/map_asn1.c +++ b/src/map_asn1.c @@ -409,6 +409,8 @@ BlobList_t *BlobList_from_bloblist( ) { bool allocated = !result; + if (!max_blob_size) + max_blob_size = SIZE_MAX; assert(list && list->value); if (!(list && list->value)) @@ -517,6 +519,8 @@ bloblist_t *BlobList_to_bloblist( ) { bool allocated = !result; + if (!max_blob_size) + max_blob_size = SIZE_MAX; assert(list); if (!list) @@ -617,6 +621,8 @@ PEPMessage_t *PEPMessage_from_message( ) { bool allocated = !result; + if (!max_blob_size) + max_blob_size = SIZE_MAX; assert(msg); if (!msg) @@ -856,6 +862,8 @@ message *PEPMessage_to_message( ) { bool allocated = !result; + if (!max_blob_size) + max_blob_size = SIZE_MAX; assert(msg); if (!msg) diff --git a/src/map_asn1.h b/src/map_asn1.h index b82846af..19037f94 100644 --- a/src/map_asn1.h +++ b/src/map_asn1.h @@ -212,6 +212,7 @@ stringlist_t *PStringList_to_stringlist( * @param result[inout] BlobList_t to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size + * to disable set to 0 * * @retval pointer to updated or allocated result * @@ -236,6 +237,7 @@ BlobList_t *BlobList_from_bloblist( * @param result[inout] bloblist_t to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size + * to disable set to 0 * * @retval pointer to updated or allocated result * @@ -260,6 +262,7 @@ bloblist_t *BlobList_to_bloblist( * @param result[inout] PEPMessage_t to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size + * to disable set to 0 * * @retval pointer to updated or allocated result * @@ -284,6 +287,7 @@ PEPMessage_t *PEPMessage_from_message( * @param result[inout] message to update or NULL to alloc a new one * @param copy copy data if true, move data otherwise * @param max_blob_size reject if sum(blob.size) > max_blob_size + * to disable set to 0 * * @retval pointer to updated or allocated result *