Skip to content

Commit

Permalink
Merge pull request #18002 from timothyklemm/hpcc-27310-coverity_lnuid
Browse files Browse the repository at this point in the history
HPCC-27310 Fix Coverity scan issue in lnuid

Reviewed-by: Gavin Halliday <[email protected]>
Merged-by: Gavin Halliday <[email protected]>
  • Loading branch information
ghalliday authored Oct 24, 2024
2 parents ea449dc + 60ad141 commit 25d37ce
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/globalid/lnuid.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ namespace ln_uid {
fp = fopen("/dev/urandom", "r");
if (!fp || fread(&randomdata, 1, random_byte_count, fp) != random_byte_count)
{
// Should never happen, but if it does log it and ignore
// Should never happen, but if it does log it and fallback
OERRLOG("Could not read data from /dev/urandom");
std::generate_n(randomdata, random_byte_count, [](){ return char(rand()); });
}
if (fp)
fclose(fp);
Expand Down

0 comments on commit 25d37ce

Please sign in to comment.