Skip to content

Commit

Permalink
trivial: Add NULL check before strlen
Browse files Browse the repository at this point in the history
  • Loading branch information
ximion committed Jan 18, 2024
1 parent 5e88dad commit 4d97479
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/as-validator.c
Original file line number Diff line number Diff line change
Expand Up @@ -2930,7 +2930,7 @@ as_validator_validate_component_node (AsValidator *validator, AsContext *ctx, xm
"name-has-dot-suffix",
node_content);

if (lang == NULL && strlen (node_content) > 40) {
if (lang == NULL && node_content != NULL && strlen (node_content) > 40) {
as_validator_add_issue (validator,
iter,
"component-name-too-long",
Expand Down Expand Up @@ -2971,7 +2971,7 @@ as_validator_validate_component_node (AsValidator *validator, AsContext *ctx, xm
"summary-first-word-not-capitalized",
NULL);

if (lang == NULL && strlen (summary) > 90) {
if (lang == NULL && summary != NULL && strlen (summary) > 90) {
as_validator_add_issue (validator,
iter,
"summary-too-long",
Expand Down

0 comments on commit 4d97479

Please sign in to comment.