From 546ae9737b710ccb712b70c80b5f14cc22563550 Mon Sep 17 00:00:00 2001 From: sxhlinux Date: Thu, 10 Jul 2014 22:09:13 +0800 Subject: [PATCH] Update log-file.c test whether tx_ud is NULL --- src/log-file.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/log-file.c b/src/log-file.c index 1cf10b584c..688edff369 100644 --- a/src/log-file.c +++ b/src/log-file.c @@ -74,12 +74,14 @@ static void LogFileMetaGetUri(FILE *fp, const Packet *p, const File *ff) { htp_tx_t *tx = AppLayerParserGetTx(IPPROTO_TCP, ALPROTO_HTTP, htp_state, ff->txid); if (tx != NULL) { HtpTxUserData *tx_ud = htp_tx_get_user_data(tx); - if (tx_ud->request_uri_normalized != NULL) { - PrintRawJsonFp(fp, - bstr_ptr(tx_ud->request_uri_normalized), - bstr_len(tx_ud->request_uri_normalized)); + if (tx_ud != NULL) { + if (tx_ud->request_uri_normalized != NULL) { + PrintRawJsonFp(fp, + bstr_ptr(tx_ud->request_uri_normalized), + bstr_len(tx_ud->request_uri_normalized)); + return; + } } - return; } } -- 2.47.3