summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Zaoui <daniel.zaoui@yahoo.com>2018-06-04 13:35:18 +0300
committerDaniel Zaoui <daniel.zaoui@yahoo.com>2018-06-04 13:35:18 +0300
commit4b5ced9b07addab51ba8d87be7bdb1fd8c35837b (patch)
tree35959f8a1d43a40e92225335398c0f242aab6362
parentab22f74b0a913afc7da288de2441ec88d5dbd839 (diff)
Fix potention buffer overflow
-rw-r--r--src/lib/unit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/lib/unit.c b/src/lib/unit.c
index 60661c6..8ef4d32 100644
--- a/src/lib/unit.c
+++ b/src/lib/unit.c
@@ -269,7 +269,7 @@ exactness_unit_file_read(const char *filename)
269 unit = eet_data_read(file, _unit_desc_make(), "cache"); 269 unit = eet_data_read(file, _unit_desc_make(), "cache");
270 for (i = 0; i < unit->nb_shots; i++) 270 for (i = 0; i < unit->nb_shots; i++)
271 { 271 {
272 char entry[16]; 272 char entry[32];
273 Exactness_Image *ex_img = malloc(sizeof(*ex_img)); 273 Exactness_Image *ex_img = malloc(sizeof(*ex_img));
274 sprintf(entry, "images/%d", i + 1); 274 sprintf(entry, "images/%d", i + 1);
275 ex_img->pixels = eet_data_image_read(file, entry, 275 ex_img->pixels = eet_data_image_read(file, entry,
@@ -313,7 +313,7 @@ exactness_unit_file_write(Exactness_Unit *unit, const char *filename)
313 eet_data_write(file, _unit_desc_make(), "cache", unit, EINA_TRUE); 313 eet_data_write(file, _unit_desc_make(), "cache", unit, EINA_TRUE);
314 EINA_LIST_FOREACH(unit->imgs, itr, ex_img) 314 EINA_LIST_FOREACH(unit->imgs, itr, ex_img)
315 { 315 {
316 char entry[16]; 316 char entry[32];
317 sprintf(entry, "images/%d", i++); 317 sprintf(entry, "images/%d", i++);
318 eet_data_image_write(file, entry, 318 eet_data_image_write(file, entry,
319 ex_img->pixels, ex_img->w, ex_img->h, 0xFF, 319 ex_img->pixels, ex_img->w, ex_img->h, 0xFF,