add some bounds, for a subsequent commit:
• all writers of exstat ensure the value is in [0; 0xFF] • all readers of exstat AND it with 0xFF (not strictly needed thus) • trap_exstat is “safe”, i.e. always either -1 or [0; 0xFF]
This commit is contained in:
4
var.c
4
var.c
@ -27,7 +27,7 @@
|
||||
#include <sys/sysctl.h>
|
||||
#endif
|
||||
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.153 2012/07/30 21:37:17 tg Exp $");
|
||||
__RCSID("$MirOS: src/bin/mksh/var.c,v 1.154 2012/10/21 21:39:06 tg Exp $");
|
||||
|
||||
/*-
|
||||
* Variables
|
||||
@ -260,7 +260,7 @@ global(const char *n)
|
||||
vp->flag &= ~(ISSET|INTEGER);
|
||||
break;
|
||||
case '?':
|
||||
vp->val.i = exstat;
|
||||
vp->val.i = exstat & 0xFF;
|
||||
break;
|
||||
case '#':
|
||||
vp->val.i = l->argc;
|
||||
|
Reference in New Issue
Block a user