From: jh0506.yun Date: Thu, 25 Nov 2010 05:37:54 +0000 (+0900) Subject: [SVN MERGE] EET merge X-Git-Tag: 2.0_alpha~105 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=99d66dbd04fd058e21e16e89a49fe5f3acb8ffb0;p=framework%2Fuifw%2Feet.git [SVN MERGE] EET merge --- diff --git a/COPYING-PLAIN b/COPYING-PLAIN deleted file mode 100644 index 376875e..0000000 --- a/COPYING-PLAIN +++ /dev/null @@ -1,33 +0,0 @@ -Plain English Copyright Notice - -This file is not intended to be the actual License. The reason this file -exists is that we here are programmers and engineers. We aren't lawyers. We -provide licenses that we THINK say the right things, but we have our own -intentions at heart. This is a plain-english explanation of what those -intentions are, and if you follow them you will be within the "spirit" of -the license. - -The intent is for us to enjoy writing software that is useful to us (the -AUTHORS) and allow others to use it freely and also benefit from the work we -put into making it. We don't want to restrict others using it. They should -not *HAVE* to make the source code of the applications they write that -simply link to these libraries (be that statically or dynamically), or for -them to be limited as to what license they choose to use (be it open, closed -or anything else). But we would like to know you are using these libraries. -We simply would like to know that it has been useful to someone. This is why -we ask for acknowledgement of some sort. - -You can do what you want with the source of this software - it doesn't -matter. We still have it here for ourselves and it is open and free to use -and download and play with. It can't be taken away. We don't really mind what -you do with the source to your software. We would simply like to know that -you are using it - especially if it makes it to a commerical product. If you -simply e-mail all the AUTHORS (see COPYING and AUTHORS files) telling us, and -then make sure you include a paragraph or page in the manual for the product -with the copyright notice and state that you used this software, we will be -very happy. If you want to contribute back modifications and fixes you may have -made we will welcome those too with open arms (generally). If you want help -with changes needed, ports needed or features to be added, arrangements can -be easily made with some dialogue. - -Carsten Haitzler diff --git a/ChangeLog b/ChangeLog index 3881dff..61b2e80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -440,3 +440,17 @@ 2010-09-02 Cedric BAIL * Fix bug of ever growing dictionnary and improve strcmp comparison. + +2010-11-12 Cedric BAIL + + * Don't try to read broken file when open in READ_WRITE mode. + +2010-11-14 Cedric BAIL + + * Fix bug with cypher and compression used together. + +2010-11-21 Carsten Haitzler (The Rasterman) + + * Fix another bug related to cipher and compression (leak and + bad free) + diff --git a/Makefile.am b/Makefile.am index 7e66af7..6edc9db 100644 --- a/Makefile.am +++ b/Makefile.am @@ -7,13 +7,13 @@ Makefile.in \ aclocal.m4 \ compile \ config.guess \ -config.h.in \ -config.sub \ -configure \ +config.h.in \ +config.sub \ +configure \ depcomp \ install-sh \ -ltmain.sh \ -missing \ +ltmain.sh \ +missing \ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz \ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 \ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-doc.tar.bz2 \ diff --git a/configure.ac b/configure.ac index 00eb7b8..a492a97 100644 --- a/configure.ac +++ b/configure.ac @@ -18,7 +18,7 @@ m4_define([lt_age], v_min) ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## ##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--##--## -AC_INIT([eet], [v_ver.beta], [enlightenment-devel@lists.sourceforge.net]) +AC_INIT([eet], [v_ver.beta2], [enlightenment-devel@lists.sourceforge.net]) AC_PREREQ([2.52]) AC_CONFIG_SRCDIR([configure.ac]) AC_CONFIG_MACRO_DIR([m4]) diff --git a/doc/img/_.gif b/doc/img/_.gif deleted file mode 100644 index 60fa7a1..0000000 Binary files a/doc/img/_.gif and /dev/null differ diff --git a/doc/img/b.png b/doc/img/b.png deleted file mode 100644 index 6fbfc2b..0000000 Binary files a/doc/img/b.png and /dev/null differ diff --git a/doc/img/eet_big.png b/doc/img/eet_big.png deleted file mode 100644 index cd818f7..0000000 Binary files a/doc/img/eet_big.png and /dev/null differ diff --git a/doc/img/eet_mini.png b/doc/img/eet_mini.png deleted file mode 100644 index f4f99f0..0000000 Binary files a/doc/img/eet_mini.png and /dev/null differ diff --git a/doc/img/eet_small.png b/doc/img/eet_small.png deleted file mode 100644 index 8bea367..0000000 Binary files a/doc/img/eet_small.png and /dev/null differ diff --git a/doc/img/embryo.png b/doc/img/embryo.png deleted file mode 100644 index 47597a8..0000000 Binary files a/doc/img/embryo.png and /dev/null differ diff --git a/doc/img/embryo_big.png b/doc/img/embryo_big.png deleted file mode 100644 index cd818f7..0000000 Binary files a/doc/img/embryo_big.png and /dev/null differ diff --git a/doc/img/embryo_mini.png b/doc/img/embryo_mini.png deleted file mode 100644 index f4f99f0..0000000 Binary files a/doc/img/embryo_mini.png and /dev/null differ diff --git a/doc/img/embryo_small.png b/doc/img/embryo_small.png deleted file mode 100644 index 8bea367..0000000 Binary files a/doc/img/embryo_small.png and /dev/null differ diff --git a/doc/img/evas.png b/doc/img/evas.png deleted file mode 100644 index 47597a8..0000000 Binary files a/doc/img/evas.png and /dev/null differ diff --git a/doc/img/evas_big.png b/doc/img/evas_big.png deleted file mode 100644 index cd818f7..0000000 Binary files a/doc/img/evas_big.png and /dev/null differ diff --git a/doc/img/evas_mini.png b/doc/img/evas_mini.png deleted file mode 100644 index f4f99f0..0000000 Binary files a/doc/img/evas_mini.png and /dev/null differ diff --git a/doc/img/evas_small.png b/doc/img/evas_small.png deleted file mode 100644 index 8bea367..0000000 Binary files a/doc/img/evas_small.png and /dev/null differ diff --git a/doc/img/n.gif b/doc/img/n.gif deleted file mode 100644 index 8c3148f..0000000 Binary files a/doc/img/n.gif and /dev/null differ diff --git a/doc/img/n.png b/doc/img/n.png deleted file mode 100644 index 6d80004..0000000 Binary files a/doc/img/n.png and /dev/null differ diff --git a/doc/img/t.gif b/doc/img/t.gif deleted file mode 100644 index cff3068..0000000 Binary files a/doc/img/t.gif and /dev/null differ diff --git a/doc/img/t.png b/doc/img/t.png deleted file mode 100644 index 5a40479..0000000 Binary files a/doc/img/t.png and /dev/null differ diff --git a/doc/img/tl.gif b/doc/img/tl.gif deleted file mode 100644 index c5e973a..0000000 Binary files a/doc/img/tl.gif and /dev/null differ diff --git a/doc/img/tl.png b/doc/img/tl.png deleted file mode 100644 index b14a7f1..0000000 Binary files a/doc/img/tl.png and /dev/null differ diff --git a/m4/efl_pthread.m4 b/m4/efl_pthread.m4 deleted file mode 100644 index 1894ad7..0000000 --- a/m4/efl_pthread.m4 +++ /dev/null @@ -1,130 +0,0 @@ -dnl Copyright (C) 2010 Vincent Torri -dnl That code is public domain and can be freely used or copied. - -dnl Macro that check if several pthread library is available or not. - -dnl Usage: EFL_CHECK_PTHREAD(want_pthread_spin[, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]) -dnl Call AC_SUBST(EFL_PTHREAD_CFLAGS) -dnl Call AC_SUBST(EFL_PTHREAD_LIBS) -dnl Define EFL_HAVE_PTHREAD -dnl Define EFL_HAVE_PTHREAD_SPINLOCK - -AC_DEFUN([EFL_CHECK_PTHREAD], -[ - -dnl configure option - -AC_ARG_ENABLE([pthread], - [AC_HELP_STRING([--disable-pthread], [enable POSIX threads code @<:@default=auto@:>@])], - [ - if test "x${enableval}" = "xyes" ; then - _efl_enable_pthread="yes" - else - _efl_enable_pthread="no" - fi - ], - [_efl_enable_pthread="auto"]) - -AC_MSG_CHECKING([whether to build POSIX threads code]) -AC_MSG_RESULT([${_efl_enable_pthread}]) - -dnl check if the compiler supports pthreads - -case "$host_os" in - mingw*) - _efl_pthread_cflags="" - _efl_pthread_libs="-lpthreadGC2" - ;; - solaris*) - _efl_pthread_cflags="-mt" - _efl_pthread_libs="-mt" - ;; - *) - _efl_pthread_cflags="-pthread" - _efl_pthread_libs="-pthread" - ;; -esac - -_efl_have_pthread="no" - -if test "x${_efl_enable_pthread}" = "xyes" || test "x${_efl_enable_pthread}" = "xauto" ; then - - SAVE_CFLAGS=${CFLAGS} - CFLAGS="${CFLAGS} ${_efl_pthread_cflags}" - SAVE_LDFLAGS=${LDFLAGS} - LDFLAGS="${LDFLAGS} ${_efl_pthread_libs}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[ -#include - ]], - [[ -pthread_t id; -id = pthread_self(); - ]])], - [_efl_have_pthread="yes"], - [_efl_have_pthread="no"]) - CFLAGS=${SAVE_CFLAGS} - LDFLAGS=${SAVE_LDFLAGS} - -fi - -AC_MSG_CHECKING([whether system support POSIX threads]) -AC_MSG_RESULT([${_efl_have_pthread}]) -if test "$x{_efl_enable_pthread}" = "xyes" && test "x${_efl_have_pthread}" = "xno"; then - AC_MSG_ERROR([pthread support requested but not found.]) -fi - -EFL_PTHREAD_CFLAGS="" -EFL_PTHREAD_LIBS="" -if test "x${_efl_have_pthread}" = "xyes" ; then - EFL_PTHREAD_CFLAGS=${_efl_pthread_cflags} - EFL_PTHREAD_LIBS=${_efl_pthread_libs} -fi - -AC_SUBST(EFL_PTHREAD_CFLAGS) -AC_SUBST(EFL_PTHREAD_LIBS) - -if test "x${_efl_have_pthread}" = "xyes" ; then - AC_DEFINE(EFL_HAVE_PTHREAD, 1, [Define to mention that POSIX threads are supported]) -fi - -dnl check if the compiler supports pthreads spinlock - -_efl_have_pthread_spinlock="no" - -if test "x${_efl_have_pthread}" = "xyes" && test "x$1" = "xyes" ; then - - SAVE_CFLAGS=${CFLAGS} - CFLAGS="${CFLAGS} ${EFL_PTHREAD_CFLAGS}" - SAVE_LDFLAGS=${LDFLAGS} - LDFLAGS="${LDFLAGS} ${EFL_PTHREAD_LIBS}" - AC_LINK_IFELSE( - [AC_LANG_PROGRAM([[ -#include - ]], - [[ -pthread_spinlock_t lock; -int res; -res = pthread_spin_init(&lock, PTHREAD_PROCESS_PRIVATE); - ]])], - [_efl_have_pthread_spinlock="yes"], - [_efl_have_pthread_spinlock="no"]) - CFLAGS=${SAVE_CFLAGS} - LDFLAGS=${SAVE_LDFLAGS} - -fi - -AC_MSG_CHECKING([whether to build POSIX threads spinlock code]) -AC_MSG_RESULT([${_efl_have_pthread_spinlock}]) -if test "x${_efl_enable_pthread}" = "xyes" && test "x${_efl_have_pthread_spinlock}" = "xno" && test "x$1" = "xyes" ; then - AC_MSG_WARN([pthread support requested but spinlocks are not supported]) -fi - -if test "x${_efl_have_pthread_spinlock}" = "xyes" ; then - AC_DEFINE(EFL_HAVE_PTHREAD_SPINLOCK, 1, [Define to mention that POSIX threads spinlocks are supported]) -fi - -AS_IF([test "x$_efl_have_pthread" = "xyes"], [$2], [$3]) -AS_IF([test "x$_efl_have_pthread_spinlock" = "xyes"], [$4], [$5]) - -]) diff --git a/m4/efl_threads.m4 b/m4/efl_threads.m4 index 8866e37..7c1a0b6 100644 --- a/m4/efl_threads.m4 +++ b/m4/efl_threads.m4 @@ -85,12 +85,12 @@ case "$host_os" in mingw*) ;; solaris*) - _efl_thread_cflags="-mt" - _efl_thread_libs="-mt" + _efl_threads_cflags="-mt" + _efl_threads_libs="-mt" ;; *) - _efl_thread_cflags="-pthread" - _efl_thread_libs="-pthread" + _efl_threads_cflags="-pthread" + _efl_threads_libs="-pthread" ;; esac @@ -127,8 +127,8 @@ fi EFL_PTHREAD_CFLAGS="" EFL_PTHREAD_LIBS="" if test "x${_efl_have_posix_threads}" = "xyes" ; then - EFL_PTHREAD_CFLAGS=${_efl_thread_cflags} - EFL_PTHREAD_LIBS=${_efl_thread_libs} + EFL_PTHREAD_CFLAGS=${_efl_threads_cflags} + EFL_PTHREAD_LIBS=${_efl_threads_libs} fi AC_SUBST(EFL_PTHREAD_CFLAGS) diff --git a/readme.slp2 b/readme.slp2 deleted file mode 100644 index 89c91f8..0000000 --- a/readme.slp2 +++ /dev/null @@ -1 +0,0 @@ -EFL:eet repo for SLP2 diff --git a/src/lib/Eet.h b/src/lib/Eet.h index 7a97368..68d942a 100644 --- a/src/lib/Eet.h +++ b/src/lib/Eet.h @@ -268,10 +268,10 @@ eet_open(const char *file, Eet_File_Mode mode); /** - * Open an eet file directly from a memory location. The data are not copied, - * so you must keep them around as long as the eet file is open. Their is - * currently no cache for this kind of Eet_File, so it's reopen every time - * you do use eet_memopen_read. + * Open an eet file directly from a memory location. The data is not copied, + * so you must keep it around as long as the eet file is open. There is + * currently no cache for this kind of Eet_File, so it's reopened every time + * you use eet_memopen_read. * * @since 1.1.0 * @ingroup Eet_File_Group diff --git a/src/lib/eet_data.c b/src/lib/eet_data.c index f607e6b..efb9fb5 100644 --- a/src/lib/eet_data.c +++ b/src/lib/eet_data.c @@ -3613,7 +3613,10 @@ eet_data_get_array(Eet_Free_Context *context, if (dst) { memcpy(dst, data_ret, subsize); - if (edd) edd->func.mem_free(data_ret); + if ((ede) && (ede->subtype)) + ede->subtype->func.mem_free(data_ret); + else if (edd) + edd->func.mem_free(data_ret); else free(data_ret); _eet_freelist_del(context, data_ret); } diff --git a/src/lib/eet_lib.c b/src/lib/eet_lib.c index d4b0ec1..7fc6d1b 100644 --- a/src/lib/eet_lib.c +++ b/src/lib/eet_lib.c @@ -1552,14 +1552,19 @@ eet_open(const char *file, { fclose(fp); fp = NULL; + + memset(&file_stat, 0, sizeof(file_stat)); + goto open_error; } - if ((mode == EET_FILE_MODE_READ) && - (file_stat.st_size < ((int)sizeof(int) * 3))) + if (file_stat.st_size < ((int)sizeof(int) * 3)) { fclose(fp); fp = NULL; + + memset(&file_stat, 0, sizeof(file_stat)); + goto open_error; } @@ -1797,15 +1802,21 @@ eet_read_cipher(Eet_File *ef, unsigned int data_deciphered_sz = 0; /* if we already have the data in ram... copy that */ + if (efn->ciphered && efn->size > size) + { + size = efn->size; + data = realloc(data, efn->size); + } + if (efn->data) - memcpy(data, efn->data, efn->size); + memcpy(data, efn->data, size); else - if (!read_data_from_disk(ef, efn, data, size)) - goto on_error; + if (!read_data_from_disk(ef, efn, data, size)) + goto on_error; if (efn->ciphered && cipher_key) { - if (eet_decipher(data, size, cipher_key, strlen(cipher_key), + if (eet_decipher(data, efn->size, cipher_key, strlen(cipher_key), &data_deciphered, &data_deciphered_sz)) { if (data_deciphered) @@ -1822,7 +1833,7 @@ eet_read_cipher(Eet_File *ef, /* compressed data */ else { - void *tmp_data; + void *tmp_data = NULL; void *data_deciphered = NULL; unsigned int data_deciphered_sz = 0; int free_tmp = 0; @@ -1862,7 +1873,9 @@ eet_read_cipher(Eet_File *ef, goto on_error; } - free(tmp_data); + if (free_tmp) + free(tmp_data); + free_tmp = 1; tmp_data = data_deciphered; compr_size = data_deciphered_sz; } @@ -1871,7 +1884,11 @@ eet_read_cipher(Eet_File *ef, dlen = size; if (uncompress((Bytef *)data, &dlen, tmp_data, (uLongf)compr_size)) - goto on_error; + { + if (free_tmp) + free(tmp_data); + goto on_error; + } if (free_tmp) free(tmp_data); @@ -2282,7 +2299,6 @@ eet_write_cipher(Eet_File *ef, data2 = data_ciphered; data_size = data_ciphered_sz; - size = (data_size > size) ? data_size : size; } else { diff --git a/src/lib/eet_node.c b/src/lib/eet_node.c index db1c58c..190bc07 100644 --- a/src/lib/eet_node.c +++ b/src/lib/eet_node.c @@ -723,7 +723,11 @@ eet_node_init(void) const char *choice; const char *tmp; +#ifdef EINA_DEFAULT_MEMPOOL + choice = "pass_through"; +#else choice = "chained_mempool"; +#endif tmp = getenv("EET_MEMPOOL"); if (tmp && tmp[0]) choice = tmp; diff --git a/src/tests/Makefile.am b/src/tests/Makefile.am index 170a3e5..c90a1d5 100644 --- a/src/tests/Makefile.am +++ b/src/tests/Makefile.am @@ -14,4 +14,4 @@ eet_suite_LDADD = $(top_builddir)/src/lib/libeet.la @EINA_LIBS@ @CHECK_LIBS@ endif -EXTRA_DIST = eet_suite.h +EXTRA_DIST = eet_suite.h cert.pem key_enc_none.pem key_enc.pem key.pem