diff options
author | Artem Popov <artem.popov@samsung.com> | 2016-11-11 09:57:38 -0800 |
---|---|---|
committer | Cedric Bail <cedric@osg.samsung.com> | 2016-11-11 09:58:30 -0800 |
commit | e6b074ad214abb6bb563c1762934631ad0ecc2d4 (patch) | |
tree | b138c979babb4ac4499232981794da55ccc5bf89 | |
parent | cc9e9c57d4b813d117a3fa8e59a74c0b2331a606 (diff) | |
download | efl-e6b074ad214abb6bb563c1762934631ad0ecc2d4.tar.gz |
eet: add to basic eet_image EAPIs checking on NULL
@fix
Summary: to avoid segfaults with NULL raw data, add checking on NULL to basic eet_image APIS
Reviewers: NikaWhite, cedric, myoungwoon, jpeg
Reviewed By: jpeg
Subscribers: t.naumenko, jpeg
Differential Revision: https://phab.enlightenment.org/D4386
Signed-off-by: Cedric Bail <cedric@osg.samsung.com>
-rw-r--r-- | src/lib/eet/eet_image.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c index 1da7985d99..b77d90e510 100644 --- a/src/lib/eet/eet_image.c +++ b/src/lib/eet/eet_image.c @@ -1577,6 +1577,9 @@ eet_data_image_encode_cipher(const void *data, unsigned int ciphered_sz = 0; int size = 0; + if (!data) + return NULL; + switch (lossy) { case EET_IMAGE_LOSSLESS: @@ -1688,6 +1691,9 @@ eet_data_image_header_advance_decode_cipher(const void *data, unsigned int deciphered_sz = 0; int r = 0; + if (!data) + return NULL; + if (cipher_key) { if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), @@ -2083,6 +2089,9 @@ eet_data_image_decode_cipher(const void *data, void *deciphered_d = NULL; unsigned int deciphered_sz = 0; + if (!data) + return NULL; + if (cipher_key) { if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), @@ -2171,6 +2180,9 @@ eet_data_image_decode_to_cspace_surface_cipher(const void *data, void *deciphered_d = NULL; unsigned int deciphered_sz = 0; + if (!data) + return NULL; + if (cipher_key) { if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), |