diff options
author | Don Anderson <dda@ddanderson.com> | 2015-04-29 12:31:07 -0400 |
---|---|---|
committer | Don Anderson <dda@ddanderson.com> | 2015-04-29 12:31:07 -0400 |
commit | a9014e5e380c31246291209ca4293a16462f7e4e (patch) | |
tree | 2660e5b12e62d2aa65f871b2d69371f17ccc8b1d /ext | |
parent | 42561b67d400b97b4d972c7b3ae8d5e997de4a7a (diff) | |
download | mongo-a9014e5e380c31246291209ca4293a16462f7e4e.tar.gz |
Fixed uninitialized variable. References WT-1822.
Diffstat (limited to 'ext')
-rw-r--r-- | ext/encryptors/rotn/rotn_encrypt.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/ext/encryptors/rotn/rotn_encrypt.c b/ext/encryptors/rotn/rotn_encrypt.c index 22595419d56..ad6b937d853 100644 --- a/ext/encryptors/rotn/rotn_encrypt.c +++ b/ext/encryptors/rotn/rotn_encrypt.c @@ -188,7 +188,7 @@ rotn_encrypt(WT_ENCRYPTOR *encryptor, WT_SESSION *session, do_rotate(&dst[i], src_len, rotn_encryptor->rot_N); else do_shift(&dst[i], src_len, - rotn_encryptor->shift_forw, rotn_encryptor->shift_len); + rotn_encryptor->shift_forw, rotn_encryptor->shift_len); /* * Checksum the encrypted buffer and add the IV. */ @@ -251,7 +251,7 @@ rotn_decrypt(WT_ENCRYPTOR *encryptor, WT_SESSION *session, do_rotate(&dst[0], mylen, 26 - rotn_encryptor->rot_N); else do_shift(&dst[0], mylen, - rotn_encryptor->shift_back, rotn_encryptor->shift_len); + rotn_encryptor->shift_back, rotn_encryptor->shift_len); *result_lenp = mylen; return (0); } @@ -292,6 +292,7 @@ rotn_customize(WT_ENCRYPTOR *encryptor, WT_SESSION *session, WT_EXTENSION_API *wt_api; ret = 0; + keyid_val = 0; orig = (const ROTN_ENCRYPTOR *)encryptor; wt_api = orig->wt_api; @@ -302,18 +303,17 @@ rotn_customize(WT_ENCRYPTOR *encryptor, WT_SESSION *session, rotn_encryptor->keyid = rotn_encryptor->secretkey = NULL; /* - * In this demonstration, we expect keyid to be a number. - */ - if ((keyid_val = atoi(keyid.str)) < 0) { - ret = EINVAL; - goto err; - } - - /* * Stash the keyid from the configuration string. */ if ((ret = wt_api->config_get(wt_api, session, encrypt_config, "keyid", &keyid)) == 0 && keyid.len != 0) { + /* + * In this demonstration, we expect keyid to be a number. + */ + if ((keyid_val = atoi(keyid.str)) < 0) { + ret = EINVAL; + goto err; + } if ((rotn_encryptor->keyid = malloc(keyid.len + 1)) == NULL) { ret = errno; goto err; |