summaryrefslogtreecommitdiff
path: root/src/lib/eet
diff options
context:
space:
mode:
authorArtem Popov <artem.popov@samsung.com>2016-11-11 09:57:38 -0800
committerCedric Bail <cedric@osg.samsung.com>2016-11-11 09:58:30 -0800
commite6b074ad214abb6bb563c1762934631ad0ecc2d4 (patch)
treeb138c979babb4ac4499232981794da55ccc5bf89 /src/lib/eet
parentcc9e9c57d4b813d117a3fa8e59a74c0b2331a606 (diff)
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>
Diffstat (limited to 'src/lib/eet')
-rw-r--r--src/lib/eet/eet_image.c12
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,
1577 unsigned int ciphered_sz = 0; 1577 unsigned int ciphered_sz = 0;
1578 int size = 0; 1578 int size = 0;
1579 1579
1580 if (!data)
1581 return NULL;
1582
1580 switch (lossy) 1583 switch (lossy)
1581 { 1584 {
1582 case EET_IMAGE_LOSSLESS: 1585 case EET_IMAGE_LOSSLESS:
@@ -1688,6 +1691,9 @@ eet_data_image_header_advance_decode_cipher(const void *data,
1688 unsigned int deciphered_sz = 0; 1691 unsigned int deciphered_sz = 0;
1689 int r = 0; 1692 int r = 0;
1690 1693
1694 if (!data)
1695 return NULL;
1696
1691 if (cipher_key) 1697 if (cipher_key)
1692 { 1698 {
1693 if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), 1699 if (!eet_decipher(data, size, cipher_key, strlen(cipher_key),
@@ -2083,6 +2089,9 @@ eet_data_image_decode_cipher(const void *data,
2083 void *deciphered_d = NULL; 2089 void *deciphered_d = NULL;
2084 unsigned int deciphered_sz = 0; 2090 unsigned int deciphered_sz = 0;
2085 2091
2092 if (!data)
2093 return NULL;
2094
2086 if (cipher_key) 2095 if (cipher_key)
2087 { 2096 {
2088 if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), 2097 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,
2171 void *deciphered_d = NULL; 2180 void *deciphered_d = NULL;
2172 unsigned int deciphered_sz = 0; 2181 unsigned int deciphered_sz = 0;
2173 2182
2183 if (!data)
2184 return NULL;
2185
2174 if (cipher_key) 2186 if (cipher_key)
2175 { 2187 {
2176 if (!eet_decipher(data, size, cipher_key, strlen(cipher_key), 2188 if (!eet_decipher(data, size, cipher_key, strlen(cipher_key),