Avoid potentially accessing uninitialized values

This commit is contained in:
Moritz Bunkus 2013-05-02 11:35:01 +02:00
parent b48fd7c897
commit c0dcbcea97

View File

@ -122,6 +122,7 @@ base64_decode(const std::string &src,
unsigned int values_idx;
unsigned char values[4];
memset(values, 0, 4);
for (values_idx = 0; values_idx < in_pos; values_idx++) {
values[values_idx] =
(('A' <= in[values_idx]) && ('Z' >= in[values_idx])) ? in[values_idx] - 'A'