Skip to content

Commit

Permalink
[FIXED] nuid: fix wrong sizeof in memset
Browse files Browse the repository at this point in the history
Fixes following Coverity issue:

Passing argument &globalNUID of type natsLockedNUID * and
argument 32UL (sizeof (natsNUID)) to function memset is suspicious
because sizeof (natsLockedNUID) /*40*/ is expected.

Signed-off-by: Paolo Teti <paolo.teti@gmail.com>
  • Loading branch information
Paolo Teti committed Jan 16, 2022
1 parent 24729b2 commit dc9d30c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/nuid.c
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ natsNUID_init(void)
natsStatus s;
unsigned int seed = (unsigned int) nats_NowInNanoSeconds();

memset(&globalNUID, 0, sizeof(natsNUID));
memset(&globalNUID, 0, sizeof(natsLockedNUID));

srand(seed);
_initCMWC(seed);
Expand Down

0 comments on commit dc9d30c

Please sign in to comment.