Skip to content

Commit

Permalink
Bug 1308204 - enable scan-build on lib/util, r=ttaubert
Browse files Browse the repository at this point in the history
https://nss-dev.phacility.com/D71

--HG--
extra : rebase_source : 1e59b7f9a4c27fb3995b25fb1a0a9d3a17f3872a
extra : amend_source : e8451acd0066b9e30afb520fa4a1dfd1d349fd1b
  • Loading branch information
franziskuskiefer committed Oct 6, 2016
1 parent 64df88a commit d8ff6c8
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 14 deletions.
2 changes: 1 addition & 1 deletion automation/taskcluster/scripts/run_scan_build.sh
Expand Up @@ -21,7 +21,7 @@ fi
cd nss && make nss_build_all

# we run scan-build on these folders
declare -a scan=("lib/ssl" "lib/freebl")
declare -a scan=("lib/ssl" "lib/freebl" "lib/util")
# corresponds to the number of errors that are expected in the |scan| folder
declare -a ignore=(0 0)

Expand Down
11 changes: 6 additions & 5 deletions lib/util/secasn1d.c
Expand Up @@ -1085,8 +1085,9 @@ sec_asn1d_prepare_for_contents(sec_asn1d_state *state)
state->dest,
PR_FALSE),
state->dest, PR_TRUE);
if (state != NULL)
state = sec_asn1d_init_state_based_on_template(state);
if (state != NULL) {
(void)sec_asn1d_init_state_based_on_template(state);
}
return;
}

Expand Down Expand Up @@ -1117,7 +1118,7 @@ sec_asn1d_prepare_for_contents(sec_asn1d_state *state)
* Do the "before" field notification for next in group.
*/
sec_asn1d_notify_before(state->top, state->dest, state->depth);
state = sec_asn1d_init_state_based_on_template(state);
(void)sec_asn1d_init_state_based_on_template(state);
}
} else {
/*
Expand All @@ -1142,7 +1143,7 @@ sec_asn1d_prepare_for_contents(sec_asn1d_state *state)
* Do the "before" field notification.
*/
sec_asn1d_notify_before(state->top, state->dest, state->depth);
state = sec_asn1d_init_state_based_on_template(state);
(void)sec_asn1d_init_state_based_on_template(state);
}
break;

Expand Down Expand Up @@ -1368,7 +1369,7 @@ sec_asn1d_prepare_for_contents(sec_asn1d_state *state)
state = sec_asn1d_push_state(state->top, sub, item, PR_TRUE);
if (state != NULL) {
state->substring = PR_TRUE; /* XXX propogate? */
state = sec_asn1d_init_state_based_on_template(state);
(void)sec_asn1d_init_state_based_on_template(state);
}
} else if (state->indefinite) {
/*
Expand Down
14 changes: 8 additions & 6 deletions lib/util/secasn1e.c
Expand Up @@ -759,7 +759,7 @@ sec_asn1e_write_header(sec_asn1e_state *state)
* Do the "before" field notification.
*/
sec_asn1e_notify_before(state->top, state->src, state->depth);
state = sec_asn1e_init_state_based_on_template(state);
(void)sec_asn1e_init_state_based_on_template(state);
}
return;
}
Expand Down Expand Up @@ -841,8 +841,9 @@ sec_asn1e_write_header(sec_asn1e_state *state)
SEC_ASN1GetSubtemplate(state->theTemplate, state->src, PR_TRUE);
state->place = afterContents;
state = sec_asn1e_push_state(state->top, subt, state->src, PR_TRUE);
if (state != NULL)
state = sec_asn1e_init_state_based_on_template(state);
if (state != NULL) {
(void)sec_asn1e_init_state_based_on_template(state);
}
return;
}

Expand All @@ -868,8 +869,9 @@ sec_asn1e_write_header(sec_asn1e_state *state)
subt = SEC_ASN1GetSubtemplate(state->theTemplate, state->src,
PR_TRUE);
state = sec_asn1e_push_state(state->top, subt, *group, PR_TRUE);
if (state != NULL)
state = sec_asn1e_init_state_based_on_template(state);
if (state != NULL) {
(void)sec_asn1e_init_state_based_on_template(state);
}
}
break;

Expand All @@ -886,7 +888,7 @@ sec_asn1e_write_header(sec_asn1e_state *state)
* Do the "before" field notification.
*/
sec_asn1e_notify_before(state->top, state->src, state->depth);
state = sec_asn1e_init_state_based_on_template(state);
(void)sec_asn1e_init_state_based_on_template(state);
}
break;

Expand Down
2 changes: 0 additions & 2 deletions lib/util/utilpars.c
Expand Up @@ -779,7 +779,6 @@ nssutil_mkRootFlags(PRBool hasRootCerts, PRBool hasRootTrust)
if (!first)
PORT_Strcat(flags, ",");
PORT_Strcat(flags, "hasRootTrust");
first = PR_FALSE;
}
return flags;
}
Expand Down Expand Up @@ -982,7 +981,6 @@ nssutil_mkNSSFlags(PRBool internal, PRBool isFIPS,
if (!first)
PORT_Strcat(flags, ",");
PORT_Strcat(flags, "critical");
first = PR_FALSE;
}
return flags;
}
Expand Down

0 comments on commit d8ff6c8

Please sign in to comment.