cedric pushed a commit to branch master.

http://git.enlightenment.org/core/efl.git/commit/?id=e6b074ad214abb6bb563c1762934631ad0ecc2d4

commit e6b074ad214abb6bb563c1762934631ad0ecc2d4
Author: Artem Popov <artem.po...@samsung.com>
Date:   Fri Nov 11 09:57:38 2016 -0800

    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 <ced...@osg.samsung.com>
---
 src/lib/eet/eet_image.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/lib/eet/eet_image.c b/src/lib/eet/eet_image.c
index 1da7985..b77d90e 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),

-- 


Reply via email to