Refactoring: Changed remaining check parameters starting with an 's' to the new rules...
[check_mk.git] / .werks / 5919
blobc51823ac357e7de71d10ade5024ea44650647b7f
1 Title: Windows agent crashed with a lot of transport protocols available
2 Level: 1
3 Component: checks
4 Compatible: compat
5 Edition: cre
6 Version: 1.5.0b1
7 Date: 1521100568
8 Class: fix
10 Werk #5704 introduced querying the supported IP families (IPv4/IPv6)
11 upon agent start. This query makes use of the WinAPI function
12 WSCEnumProtocols. This function turned out to contain a severe bug:
13 if the protocol buffer passed as in/out parameter is not big enough
14 to accommodate all available transport protocols, the function corrupts
15 the heap by writing to memory past the buffer. This violates the
16 MSDN documentation of WSCEnumProtocols, also the example code attached
17 to the documentation is broken.
19 So far, the bug has only been reported on older 32 bit systems
20 (Windows Server 2008). However, the real extent of the problem is not
21 known as there are no bug reports about WSCEnumProtocols publicly
22 available to determine, if the function is broken in all Windows
23 versions or just in some. A key factor is the number of
24 configured/supported transport protocols: if the number grows large
25 enough, WSCEnumProtocols causes the described buffer overflow.
27 Now the use of WSCEnumProtocols has been changed so that - on the
28 contrary to the documentation in MSDN - the function is always called
29 twice to prevent the buffer overflow by allocating the necessary buffer
30 only after first querying the necessary buffer size.