misc.c+283: respect buflen instead of unconditional QUEUE_ID_LEN
Issue #1032
resolved
Hi!
While debugging another issue i ran across the code at https://bitbucket.org/jsuto/piler/src/538019632510868ffb9dc9324dc8fe1020a83baa/src/misc.c#lines-283 .
There are always QUEUE_ID_LEN bytes copied to the buffer pointed to by buf instead of respecting the parameter buflen passed to the function.
This is probably fine for the existing code base, as all calls of make_random_string() are done with either BUFLEN-3 (==29) or QUEUE_ID_LEN as the size argument.
Cheers,
Rolf Weber
Comments (3)
-
repo owner -
repo owner - changed status to resolved
-
repo owner Ehh, you are right, this is a clumsy code, so I’ve just refactored it: https://bitbucket.org/jsuto/piler/commits/ce193974f1a68ba0d1cfb54e114b6d7584b43905
- Log in to comment
I agree, I don’t think it causes any trouble.