@@ -386,14 +386,18 @@ static void _print_rule_details(struct xccdf_policy *policy, struct xccdf_item *
386386 return ;
387387 }
388388 char * description = xccdf_policy_get_readable_item_description (policy , item , NULL );
389- char * indented_description = oscap_indent (description , 8 );
390- printf ("Description\n%s\n" , indented_description );
391- free (indented_description );
389+ if (strlen (description ) > 0 ) {
390+ char * indented_description = oscap_indent (description , 8 );
391+ printf ("Description\n%s\n" , indented_description );
392+ free (indented_description );
393+ }
392394 free (description );
393395 char * rationale = xccdf_policy_get_readable_item_rationale (policy , item , NULL );
394- char * indented_rationale = oscap_indent (rationale , 8 );
395- printf ("Rationale\n%s\n" , indented_rationale );
396- free (indented_rationale );
396+ if (strlen (rationale ) > 0 ) {
397+ char * indented_rationale = oscap_indent (rationale , 8 );
398+ printf ("Rationale\n%s\n" , indented_rationale );
399+ free (indented_rationale );
400+ }
397401 free (rationale );
398402 struct oscap_stringlist * warnings = xccdf_rule_get_warnings_strings ((struct xccdf_rule * ) item );
399403 struct oscap_string_iterator * warnings_it = oscap_stringlist_get_strings (warnings );
0 commit comments