diff --git a/rust/gen-c-headers.py b/rust/gen-c-headers.py index 0dc2973898..ac6e673344 100755 --- a/rust/gen-c-headers.py +++ b/rust/gen-c-headers.py @@ -131,7 +131,7 @@ def convert_type(rs_type): elif mod in [ "*mut *const", "*mut*const"]: - return "%s **" % (type_map[rtype]) + return "const %s **" % (type_map[rtype]) else: raise Exception("Unknown modifier '%s' in '%s'." % ( mod, rs_type)) diff --git a/src/detect-dce-stub-data.c b/src/detect-dce-stub-data.c index c9c754210d..ccbaf341cc 100644 --- a/src/detect-dce-stub-data.c +++ b/src/detect-dce-stub-data.c @@ -72,7 +72,7 @@ static InspectionBuffer *GetSMBData(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { uint32_t data_len = 0; - uint8_t *data = NULL; + const uint8_t *data = NULL; uint8_t dir = flow_flags & (STREAM_TOSERVER|STREAM_TOCLIENT); if (rs_smb_tx_get_stub_data(txv, dir, &data, &data_len) != 1) return NULL; diff --git a/src/detect-dns-query.c b/src/detect-dns-query.c index 4fdd727813..d8db60b251 100644 --- a/src/detect-dns-query.c +++ b/src/detect-dns-query.c @@ -87,7 +87,7 @@ static InspectionBuffer *DnsQueryGetData(DetectEngineThreadCtx *det_ctx, const uint8_t *data; uint32_t data_len; if (rs_dns_tx_get_query_name(cbdata->txv, (uint16_t)cbdata->local_id, - (uint8_t **)&data, &data_len) == 0) { + &data, &data_len) == 0) { return NULL; } InspectionBufferSetup(buffer, data, data_len); diff --git a/src/detect-krb5-cname.c b/src/detect-krb5-cname.c index 0a562e467c..b7c8de2bb8 100644 --- a/src/detect-krb5-cname.c +++ b/src/detect-krb5-cname.c @@ -70,7 +70,7 @@ static InspectionBuffer *GetKrb5CNameData(DetectEngineThreadCtx *det_ctx, return buffer; uint32_t b_len = 0; - uint8_t *b = NULL; + const uint8_t *b = NULL; if (rs_krb5_tx_get_cname(cbdata->txv, (uint16_t)cbdata->local_id, &b, &b_len) != 1) return NULL; diff --git a/src/detect-krb5-sname.c b/src/detect-krb5-sname.c index d5f0bf5677..cf334428a5 100644 --- a/src/detect-krb5-sname.c +++ b/src/detect-krb5-sname.c @@ -70,7 +70,7 @@ static InspectionBuffer *GetKrb5SNameData(DetectEngineThreadCtx *det_ctx, return buffer; uint32_t b_len = 0; - uint8_t *b = NULL; + const uint8_t *b = NULL; if (rs_krb5_tx_get_sname(cbdata->txv, (uint16_t)cbdata->local_id, &b, &b_len) != 1) return NULL; diff --git a/src/detect-smb-share.c b/src/detect-smb-share.c index eb7f0d80a1..f2a21d9033 100644 --- a/src/detect-smb-share.c +++ b/src/detect-smb-share.c @@ -63,7 +63,7 @@ static InspectionBuffer *GetNamedPipeData(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { uint32_t b_len = 0; - uint8_t *b = NULL; + const uint8_t *b = NULL; if (rs_smb_tx_get_named_pipe(txv, &b, &b_len) != 1) return NULL; @@ -126,7 +126,7 @@ static InspectionBuffer *GetShareData(DetectEngineThreadCtx *det_ctx, InspectionBuffer *buffer = InspectionBufferGet(det_ctx, list_id); if (buffer->inspect == NULL) { uint32_t b_len = 0; - uint8_t *b = NULL; + const uint8_t *b = NULL; if (rs_smb_tx_get_share(txv, &b, &b_len) != 1) return NULL; diff --git a/src/detect-template-rust-buffer.c b/src/detect-template-rust-buffer.c index 4a813af521..ff5c9eb53f 100644 --- a/src/detect-template-rust-buffer.c +++ b/src/detect-template-rust-buffer.c @@ -110,9 +110,9 @@ static int DetectEngineInspectTemplateRustBuffer(ThreadVars *tv, uint32_t data_len = 0; if (flags & STREAM_TOSERVER) { - rs_template_get_request_buffer(txv, (uint8_t **)&data, &data_len); + rs_template_get_request_buffer(txv, &data, &data_len); } else if (flags & STREAM_TOCLIENT) { - rs_template_get_response_buffer(txv, (uint8_t **)&data, &data_len); + rs_template_get_response_buffer(txv, &data, &data_len); } if (data != NULL) {