summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAharon Hillel <a.hillel@samsung.com>2012-11-29 11:08:58 +0000
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2012-11-29 11:08:58 +0000
commit6cdcdb1b2ef982865dfe0ec8a21085a466942cdc (patch)
tree1694f6536b5ed5b1da2c5d6f2ddb5b2610ef49da
parent507f22ea16ab632e2d69d0bee33bd97733e8660b (diff)
clouseau: Fixed _host_to_net_blob_get memory allocation size has to be divided by sizeof(uint32_t)v0.1.0
Signed-off-by: Aharon Hillel <a.hillel@samsung.com> SVN revision: 79824
-rw-r--r--src/lib/clouseau_data.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/lib/clouseau_data.c b/src/lib/clouseau_data.c
index 09d71b2..31b7c36 100644
--- a/src/lib/clouseau_data.c
+++ b/src/lib/clouseau_data.c
@@ -646,9 +646,10 @@ _host_to_net_blob_get(void *blob, int *blob_size)
646 if (!blob) 646 if (!blob)
647 return blob; 647 return blob;
648 648
649 /* Add extra long if needed */ 649 /* Complete blob_size to sizeof(uint32_t) */
650 if ((*blob_size) % sizeof(uint32_t)) 650 int mod = (*blob_size) % sizeof(uint32_t);
651 (*blob_size)++; 651 if (mod)
652 *blob_size += (sizeof(uint32_t) - mod);
652 653
653 void *n_blob = malloc(*blob_size); 654 void *n_blob = malloc(*blob_size);
654 uint32_t *src = blob; 655 uint32_t *src = blob;