Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions libopenarc/arc-canon.c
Original file line number Diff line number Diff line change
Expand Up @@ -2135,16 +2135,20 @@ arc_parse_canon_t(unsigned char *tag, arc_canon_t *hdr_canon,
return ARC_STAT_INVALID;

token = strtok_r(tag, "/", &last);
if (token == NULL)
return ARC_STAT_INVALID;

Comment on lines +2138 to +2140
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cannot happen. There will always be an initial token, because the case where the string is empty returns before this call.

code = arc_name_to_code(canonicalizations, token);

if (code == -1)
return ARC_STAT_INVALID;

*hdr_canon = (arc_canon_t) code;

token = strtok_r(NULL, "/", &last);
code = arc_name_to_code(canonicalizations, token);
if (token == NULL)
return ARC_STAT_INVALID;

code = arc_name_to_code(canonicalizations, token);
if (code == -1)
return ARC_STAT_INVALID;

Expand Down