Skip to content

Commit

Permalink
net-md5: fix buffer overflow in prepare()
Browse files Browse the repository at this point in the history
Related to #5157
  • Loading branch information
AlekseyCherepanov authored and solardiz committed Jul 2, 2022
1 parent a705c98 commit 1b47abf
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/net_md5_fmt_plug.c
Expand Up @@ -275,6 +275,8 @@ static char *prepare(char *fields[10], struct fmt_main *self) {
get_ptr();
if (text_in_dynamic_format_already(pDynamicFmt, hash))
return hash;
if (strlen(hash) + TAG_LENGTH + 1 > sizeof(buf))
return hash;
sprintf(buf, "%s%s", FORMAT_TAG, hash);
return buf;
}
Expand Down

0 comments on commit 1b47abf

Please sign in to comment.