]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
http: use more precise parameter in HtpRequestBodySetupMultipart
authorPhilippe Antoine <contact@catenacyber.fr>
Tue, 19 May 2020 11:59:56 +0000 (13:59 +0200)
committerVictor Julien <victor@inliniac.net>
Mon, 3 Aug 2020 12:04:48 +0000 (14:04 +0200)
So that we can see that it does not have to handle gaps

src/app-layer-htp.c

index 9927afb35a0387664db611a778cd386339f6e327..9940c82cbc79eecfc6d96f622dfeb7e7de440e0f 100644 (file)
@@ -1158,9 +1158,9 @@ static int HTTPParseContentTypeHeader(uint8_t *name, size_t name_len,
  *  If the request contains a multipart message, this function will
  *  set the HTP_BOUNDARY_SET in the transaction.
  */
-static int HtpRequestBodySetupMultipart(htp_tx_data_t *d, HtpTxUserData *htud)
+static int HtpRequestBodySetupMultipart(htp_tx_t *tx, HtpTxUserData *htud)
 {
-    htp_header_t *h = (htp_header_t *)htp_table_get_c(d->tx->request_headers,
+    htp_header_t *h = (htp_header_t *)htp_table_get_c(tx->request_headers,
             "Content-Type");
     if (h != NULL && bstr_len(h->value) > 0) {
         uint8_t *boundary = NULL;
@@ -1857,7 +1857,7 @@ static int HTPCallbackRequestBodyData(htp_tx_data_t *d)
 
         if (d->tx->request_method_number == HTP_M_POST) {
             SCLogDebug("POST");
-            int r = HtpRequestBodySetupMultipart(d, tx_ud);
+            int r = HtpRequestBodySetupMultipart(d->tx, tx_ud);
             if (r == 1) {
                 tx_ud->request_body_type = HTP_BODY_REQUEST_MULTIPART;
             } else if (r == 0) {