MPS issue job004040

TitleUse of uninitialized variable in ProtThreadRegister on XC
Statusclosed
Priorityessential
Assigned userGareth Rees
OrganizationRavenbrook
DescriptionIn protxc.c, the function ProtThreadRegister calls thread_swap_exception_ports passing &old_exception_count for the seventh argument, without initializing old_exception_count. The documentation [1] says, "old_exception_count [pointer to in/out scalar] On input, the maximum size of the array buffers; on output, the number of returned sets returned."
AnalysisOn input, this must have the value 1 (as this is all the space we have allocated for returned arrays).
How foundinspection
Evidence[1] http://web.mit.edu/darwin/src/modules/xnu/osfmk/man/TS_exception_ports.html
Created byGareth Rees
Created on2016-09-04 14:23:58
Last modified byGareth Rees
Last modified on2016-09-04 14:28:28
History2016-09-04 GDR Created.

Fixes

Change Effect Date User Description
192128 closed 2016-09-04 14:28:28 Gareth Rees Initialize in/out parameter old_exception_count before passing it to thread_swap_exception_ports.