Skip to content

Commit

Permalink
Merge pull request hogliux#34 from roblabla/fix-buffer-overflow
Browse files Browse the repository at this point in the history
Avoid buffer overflow when node.linkNameLength is 0
  • Loading branch information
hogliux authored Aug 7, 2023
2 parents 0e7dc7e + b05cac6 commit c41ad8b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/mkbom.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -396,7 +396,7 @@ void write_bom( istream & lsbom_file, const string & output_path ) {
info2->unknown1 = 1;
info2->checksum = htonl(node.checksum);
info2->linkNameLength = htonl(node.linkNameLength);
strcpy( info2->linkName, node.linkName.c_str() );
strncpy( info2->linkName, node.linkName.c_str(), node.linkNameLength );

BOMPathInfo1 info1;
info1.id = htonl( j + 1 );
Expand Down

0 comments on commit c41ad8b

Please sign in to comment.