lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On Fri, Dec 16, 2011 at 9:57 AM, Michael Savage <mikejsavage@gmail.com> wrote:
> luabcrypt is a wrapper around OpenBSD bcrypt that doesn't require you to
> be actually using OpenBSD.
>
> Github: https://github.com/mikejsavage/luabcrypt
>
> All feedback is welcome (including nitpicking over names etc) since I've
> not properly released any code in over a year, so I expect I did
> something wrong.

Why do you malloc small buffers with fixed sizes? Just allocate on stack:

char* buf = malloc(_PASSWORD_LEN)

  -- could be
 char buf[_PASSWORD_LEN];

etc.

Since you don't check malloc for success, it would also be more robust
not to make a library call that could fail.

Sam