imv-scanner: Only add a reason string if there is something to report
authorTobias Brunner <tobias@strongswan.org>
Thu, 25 Apr 2013 10:43:23 +0000 (12:43 +0200)
committerTobias Brunner <tobias@strongswan.org>
Mon, 8 Jul 2013 16:49:26 +0000 (18:49 +0200)
src/libimcv/plugins/imv_scanner/imv_scanner_state.c

index d8bba98..4c570c4 100644 (file)
@@ -282,7 +282,10 @@ METHOD(imv_state_t, get_reason_string, bool,
        /* Instantiate a TNC Reason String object */
        DESTROY_IF(this->reason_string);
        this->reason_string = imv_reason_string_create(*reason_language);
-       this->reason_string->add_reason(this->reason_string, reasons);
+       if (this->rec != TNC_IMV_ACTION_RECOMMENDATION_NO_RECOMMENDATION)
+       {
+               this->reason_string->add_reason(this->reason_string, reasons);
+       }
        *reason_string = this->reason_string->get_encoding(this->reason_string);
 
        return TRUE;