Source-Changes archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

CVS commit: src/sys/sys



Module Name:    src
Committed By:   kamil
Date:           Tue Jul  3 22:38:34 UTC 2018

Modified Files:
        src/sys/sys: wait.h

Log Message:
Try to appease KUBSan in sys/sys/wait.h in W_EXITCODE()

Cast return value that is stored as int to unsigned int in order to
appease the << 8 operation. In case of a ret=-1, this cast is papering
things over or replacing UB with an implementation specific behavior.

There is a reverse operation with the same papering things over:
WEXITSTATUS(x)  ((int)(((unsigned int)_W_INT(x)) >> 8) & 0xff)

No functional change intended.

Detected with Kernel Undefined Behavior Sanitizer.

Reported by <Harry Pantazis>


To generate a diff of this commit:
cvs rdiff -u -r1.35 -r1.36 src/sys/sys/wait.h

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




Home | Main Index | Thread Index | Old Index