]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
Update log-file.c 1024/head
authorsxhlinux <sxhlinux@163.com>
Thu, 10 Jul 2014 14:09:13 +0000 (22:09 +0800)
committersxhlinux <sxhlinux@163.com>
Thu, 10 Jul 2014 14:09:13 +0000 (22:09 +0800)
test whether tx_ud is NULL

src/log-file.c

index 1cf10b584cfd723cee01dc645c6df68c5ab19be2..688edff3690ba5eb1e8c9ed61e512e5eee5b9486 100644 (file)
@@ -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;
         }
     }