Commit bbdf4f421964beee05eec50a0768be9bc349e67f
1 parent
470bb5b8
64-bit fix
git-svn-id: svn+q:///qpdf/trunk@610 71b93d88-0707-0410-a8cf-f5a4172ac649
Showing
1 changed file
with
1 additions
and
1 deletions
libqpdf/QPDF_encryption.cc
| @@ -26,7 +26,7 @@ static unsigned int const key_bytes = 32; | @@ -26,7 +26,7 @@ static unsigned int const key_bytes = 32; | ||
| 26 | void | 26 | void |
| 27 | pad_or_truncate_password(std::string const& password, char k1[key_bytes]) | 27 | pad_or_truncate_password(std::string const& password, char k1[key_bytes]) |
| 28 | { | 28 | { |
| 29 | - int password_bytes = std::min(key_bytes, password.length()); | 29 | + int password_bytes = std::min((size_t) key_bytes, password.length()); |
| 30 | int pad_bytes = key_bytes - password_bytes; | 30 | int pad_bytes = key_bytes - password_bytes; |
| 31 | memcpy(k1, password.c_str(), password_bytes); | 31 | memcpy(k1, password.c_str(), password_bytes); |
| 32 | memcpy(k1 + password_bytes, padding_string, pad_bytes); | 32 | memcpy(k1 + password_bytes, padding_string, pad_bytes); |