Fix printing of invalid struct sembuf.sem_flg

* ipc_sem.c (print_sembuf): Explicitly cast struct sembuf.sem_flg
to unsigned short to avoid potential sign-extension bug when printing
invalid struct sembuf.sem_flg.
This commit is contained in:
Дмитрий Левин 2016-05-16 22:00:46 +00:00
parent a734a97d0e
commit 977aee82bf

View File

@ -49,7 +49,7 @@ print_sembuf(struct tcb *tcp, void *elem_buf, size_t elem_size, void *data)
const struct sembuf *sb = elem_buf;
tprintf("{%u, %d, ", sb->sem_num, sb->sem_op);
printflags(semop_flags, sb->sem_flg, "SEM_???");
printflags(semop_flags, (unsigned short) sb->sem_flg, "SEM_???");
tprints("}");
return true;