From: barbieri Date: Thu, 17 Sep 2009 18:37:22 +0000 (+0000) Subject: oops! strncpy is tricky and uri was a pointer not an array. X-Git-Tag: 2.0_alpha~28^2~96 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=d88c8713d012eebd1afef911268ea2b363c93779;p=framework%2Fuifw%2Fethumb.git oops! strncpy is tricky and uri was a pointer not an array. people were not noticing it as they were using 64 bits machines... but with 32 bits just 4 bytes were copied and 3 were missing :-P git-svn-id: https://svn.enlightenment.org/svn/e/trunk/ethumb@42549 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/Ethumb.c b/src/lib/Ethumb.c index 944c180..52eb069 100644 --- a/src/lib/Ethumb.c +++ b/src/lib/Ethumb.c @@ -778,8 +778,8 @@ _ethumb_generate_hash(const char *file) EINA_SAFETY_ON_NULL_RETURN_VAL(file, NULL); uri = alloca(3 * strlen(file) + 9); - strncpy(uri, "file://", sizeof(uri)); - t = uri + 7; + memcpy(uri, "file://", sizeof("file://") - 1); + t = uri + sizeof("file://") - 1; for (c = (const unsigned char *)file; *c != '\0'; c++) {