No need for strncpy in passwordCallback
authorYedidya Feldblum <yfeldblum@fb.com>
Mon, 31 Jul 2017 19:04:10 +0000 (12:04 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Mon, 31 Jul 2017 19:06:36 +0000 (12:06 -0700)
commite74ceef6f9d10b3369756904d30ec423081cd931
tree9a4771538befaada23dd12092f46a5b69b6dd55a
parentea815395588bf55ce57f505e05f5df469edf3436
No need for strncpy in passwordCallback

Summary:
[Folly] No need for `strncpy` in `passwordCallback`.

Careful reading of the documentation:

> The pem_passwd_cb must write the password into the provided buffer `buf` which is of size `size`.
>
> https://wiki.openssl.org/index.php?title=Manual:SSL_CTX_set_default_passwd_cb(3)&oldid=761

No mention is made of a requirement on the password being written into `buf` that it be null-terminated.

Reviewed By: knekritz, meyering

Differential Revision: D5524814

fbshipit-source-id: 6cfc588cdf3675281ffe39e6af376f3f0631d1b0
folly/io/async/SSLContext.cpp