davidmoreno / onion

C library to create simple HTTP servers and Web Applications.
http://www.coralbits.com/libonion/
Other
2.02k stars 252 forks source link

Fix the value of a sizeof modulus when computing a random uuid. #304

Closed Bogdanisar closed 2 years ago

Bogdanisar commented 2 years ago

We need to use sizeof(random_chars) - 1 as a modulus for random_chars instead of sizeof(random_chars) because the first variant can also return \0 in the middle of the generated c-string.

This resolves #301 .