Skip to content

Commit

Permalink
dummy debug do not merge
Browse files Browse the repository at this point in the history
  • Loading branch information
catenacyber committed Mar 11, 2024
1 parent c9efcdf commit 52712fa
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
7 changes: 5 additions & 2 deletions htp/htp_connection.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,9 +153,12 @@ htp_status_t htp_conn_remove_tx(htp_conn_t *conn, const htp_tx_t *tx) {
if (conn->transactions == NULL) return HTP_ERROR;
size_t n = htp_list_size(conn->transactions);
if (n > 0) {
htp_tx_t *tx2 = htp_list_get(conn->transactions, htp_list_size(tx->conn->transactions) - 1);
htp_tx_t *tx2 = htp_list_get(conn->transactions, n - 1);
if (tx2 != NULL) {
return htp_list_replace(conn->transactions, htp_list_size(tx->conn->transactions) - 1 + tx->index - tx2->index, NULL);
return htp_list_replace(conn->transactions, n - 1 + tx->index - tx2->index, NULL);
} else {
printf("fail with %d/%d\n", tx->index, n);
abort();
}
}
return HTP_DECLINED;
Expand Down
3 changes: 3 additions & 0 deletions htp/htp_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ htp_tx_t *htp_tx_create(htp_connp_t *connp) {
htp_tx_t *txl = htp_list_get(tx->conn->transactions, htp_list_size(tx->conn->transactions) - 1);
if (txl != NULL) {
tx->index = txl->index + 1;
} else {
printf("fail with %d\n", htp_list_size(tx->conn->transactions));
abort();
}
}
tx->cfg = connp->cfg;
Expand Down

0 comments on commit 52712fa

Please sign in to comment.