forked from enlightenment/efl
toolbar: Use snprintf for elm,number,item buffer handling
Avoid potential buffer overflow Signed-off-by: Daniel Willmann <d.willmann@samsung.com>
This commit is contained in:
parent
c88d31d027
commit
c9534bab25
|
@ -899,7 +899,7 @@ _inform_item_number(Evas_Object *obj)
|
||||||
{
|
{
|
||||||
ELM_TOOLBAR_DATA_GET(obj, sd);
|
ELM_TOOLBAR_DATA_GET(obj, sd);
|
||||||
Elm_Toolbar_Item *it;
|
Elm_Toolbar_Item *it;
|
||||||
char buf[sizeof("elm,action,click,") + 3];
|
char buf[sizeof("elm,number,item,") + 4];
|
||||||
static int scount = 0;
|
static int scount = 0;
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
|
@ -910,7 +910,8 @@ _inform_item_number(Evas_Object *obj)
|
||||||
if (scount != count)
|
if (scount != count)
|
||||||
{
|
{
|
||||||
scount = count;
|
scount = count;
|
||||||
sprintf(buf, "elm,number,item,%d", count);
|
if (snprintf(buf, sizeof(buf), "elm,number,item,%d", count) >= sizeof(buf))
|
||||||
|
ERR("Too many items to fit signal buffer (%d)", count);
|
||||||
|
|
||||||
EINA_INLIST_FOREACH(sd->items, it)
|
EINA_INLIST_FOREACH(sd->items, it)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue