Skip to content

Commit

Permalink
fix nasa#128 - strncpy should result in a null term
Browse files Browse the repository at this point in the history
  • Loading branch information
CDKnightNASA committed Sep 2, 2020
1 parent 5e879b9 commit 446179d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Subsystems/cmdUtil/cmdUtil.c
Original file line number Diff line number Diff line change
Expand Up @@ -814,7 +814,7 @@ int main(int argc, char *argv[])
}

/* Copy the data over (zero fills) */
strncpy(sbuf, &tail[1], sizeof(sbuf));
strncpy(sbuf, &tail[1], sizeof(sbuf) - 1);
CopyData(cmd.Packet, &startbyte, sbuf, tempull);

/* Reset tail so it doesn't trigger error */
Expand Down

0 comments on commit 446179d

Please sign in to comment.