We can never be cautious enough.
* defs.h (set_personality): Change argument type to unsigned int.
* syscall.c (set_personality): Change argument type to unsigned int,
check whether requested personality is sane, die otherwise.
extern void tprints_comment(const char *str);
#if SUPPORTED_PERSONALITIES > 1
-extern void set_personality(int personality);
+extern void set_personality(unsigned int personality);
extern unsigned current_personality;
#else
# define set_personality(personality) ((void)0)
# endif
void
-set_personality(int personality)
+set_personality(unsigned int personality)
{
if (personality == current_personality)
return;
+ if (personality >= SUPPORTED_PERSONALITIES)
+ error_msg_and_die("Requested switch to unsupported personality "
+ "%u", personality);
+
nsyscalls = nsyscall_vec[personality];
sysent = sysent_vec[personality];