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 7532af4
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.nuid), 0, sizeof(globalNUID.nuid));

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

0 comments on commit 7532af4

Please sign in to comment.