Check for snprintf truncation in pgtkterm
* src/pgtkterm.c (pgtk_enumerate_devices): Abort if snprintf truncated.
This commit is contained in:
parent
4a25ed300f
commit
db9ea9b77a
1 changed files with 4 additions and 3 deletions
|
@ -183,9 +183,10 @@ pgtk_enumerate_devices (struct pgtk_display_info *dpyinfo,
|
|||
rec->seat = g_object_ref (seat);
|
||||
rec->device = GDK_DEVICE (t1->data);
|
||||
|
||||
snprintf (printbuf, 1026, "%u:%s",
|
||||
gdk_device_get_source (rec->device),
|
||||
gdk_device_get_name (rec->device));
|
||||
int len = snprintf (printbuf, sizeof printbuf, "%u:%s",
|
||||
gdk_device_get_source (rec->device),
|
||||
gdk_device_get_name (rec->device));
|
||||
eassert (len < sizeof printbuf);
|
||||
|
||||
rec->name = build_string (printbuf);
|
||||
rec->next = dpyinfo->devices;
|
||||
|
|
Loading…
Add table
Reference in a new issue