From 09e241fb1271021e3615512debd3136891547562 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Thu, 27 Jul 2017 16:07:50 -0300 Subject: Security review: check results of snprintf. Calls marked with xSnprintf shouldn't fail. Abort program cleanly if any of them does. --- linux/IOPriorityPanel.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'linux/IOPriorityPanel.c') diff --git a/linux/IOPriorityPanel.c b/linux/IOPriorityPanel.c index 3085fb02..2b315b82 100644 --- a/linux/IOPriorityPanel.c +++ b/linux/IOPriorityPanel.c @@ -27,7 +27,7 @@ Panel* IOPriorityPanel_new(IOPriority currPrio) { for (int c = 0; classes[c].name; c++) { for (int i = 0; i < 8; i++) { char name[50]; - snprintf(name, sizeof(name)-1, "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : "")); + xSnprintf(name, sizeof(name)-1, "%s %d %s", classes[c].name, i, i == 0 ? "(High)" : (i == 7 ? "(Low)" : "")); IOPriority ioprio = IOPriority_tuple(classes[c].klass, i); Panel_add(this, (Object*) ListItem_new(name, ioprio)); if (currPrio == ioprio) Panel_setSelected(this, Panel_size(this) - 1); -- cgit v1.2.3