diff options
Diffstat (limited to 'pdf/pdf_crypt.c')
-rw-r--r-- | pdf/pdf_crypt.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/pdf/pdf_crypt.c b/pdf/pdf_crypt.c index cdf35d70..d29e756d 100644 --- a/pdf/pdf_crypt.c +++ b/pdf/pdf_crypt.c @@ -638,8 +638,8 @@ pdf_crypt_obj_imp(pdf_crypt *crypt, fz_obj *obj, unsigned char *key, int keylen) memcpy(iv, s, 16); aes_setkey_dec(&aes, key, keylen * 8); aes_crypt_cbc(&aes, AES_DECRYPT, n - 16, iv, s + 16, s); - obj->u.s.len -= 16; /* delete space used for iv */ - obj->u.s.len -= s[n - 17]; /* delete padding bytes at end */ + /* delete space used for iv and padding bytes at end */ + fz_set_str_len(obj, n - 16 - s[n - 17]); } } } |