Skip to content

Commit

Permalink
inform_gen: pass correct remaining length to strncat(..)
Browse files Browse the repository at this point in the history
Improved version based on CodeQL documentation.
  • Loading branch information
gavanderhoorn committed Jun 16, 2023
1 parent 9f1c599 commit fe34b07
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/InformCheckerAndGenerator.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ void Ros_InformChecker_CreateJob()
if (group->baseTrackGroupId != -1) //this robot has a base
{
sprintf(tagBuffer, ",BS%d", (group->baseTrackGroupId - MP_B1_GID) + 1);
strncat(lineBuffer, tagBuffer, MAX_JOB_LINE_LENGTH);
strncat(lineBuffer, tagBuffer,
sizeof(lineBuffer) - Ros_strnlen(lineBuffer, MAX_JOB_LINE_LENGTH) - 1);
}

FileUtilityFunctions_WriteLine(fd, lineBuffer);
Expand Down

0 comments on commit fe34b07

Please sign in to comment.