Sfoglia il codice sorgente

[mucurses] Ensure SLK labels are always terminated

Signed-off-by: Michael Brown <mcb30@ipxe.org>
tags/v1.20.1
Michael Brown 7 anni fa
parent
commit
f032556b15
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  1. 1
    1
      src/hci/mucurses/slk.c

+ 1
- 1
src/hci/mucurses/slk.c Vedi File

@@ -359,7 +359,7 @@ int slk_set ( int labnum, const char *label, int fmt ) {
359 359
 		return ERR;
360 360
 
361 361
 	strncpy(slks->fkeys[labnum].label, label,
362
-		sizeof(slks->fkeys[labnum].label));
362
+		(sizeof(slks->fkeys[labnum].label) - 1));
363 363
 	slks->fkeys[labnum].fmt = fmt;
364 364
 
365 365
 	return OK;

Loading…
Annulla
Salva