zephyr/subsys/net/lib/sockets
Paul Sokolovsky c885cb533e net: buf: linearize: Get rid of useless memset()
net_buf_linearize() used to clear the contents of output buffer,
just to fill it with data as the next step. The only effect that
would have is if less data was written to the output buffer. But
it's not reliable for a caller to rely on net_buf_linearize() for
that, instead callers should take care to handle any conditions
like that themselves. For example, a caller which wants to process
the data as zero-terminated string, must reserve a byte for it
in the output buffer explicitly (and set it to zero).

The only in-tree user which relied on clearing output buffer was
wncm14a2a.c. But either had buffer sizes calculated very precisely
to always accommodate extra trailing zero byte (without providing
code comments about this), or arguably could suffer from buffer
overruns (at least if data received from a modem was invalid and
filled up all destination buffer, leaving no space for trailing
zero).

Signed-off-by: Paul Sokolovsky <paul.sokolovsky@linaro.org>
2019-01-12 15:24:29 -06:00
..
CMakeLists.txt drivers: wifi: simplelink: Implement setsockopt() for TLS offload 2018-11-23 09:16:21 -05:00
Kconfig ext: mbedtls: Unify mbedTLS Kconfig prefixes 2018-12-17 11:27:02 +01:00
getaddrinfo.c net: Clarify logging in networking code 2018-12-07 12:00:04 +02:00
socket_offload.c net: Clarify logging in networking code 2018-12-07 12:00:04 +02:00
sockets.c net: buf: linearize: Get rid of useless memset() 2019-01-12 15:24:29 -06:00
sockets_internal.h net: sockets: Rework poll to support ioctl helper commands 2018-12-10 11:38:13 +02:00
sockets_tls.c net: sockets_tls: Typo fix in comment 2018-12-14 13:21:31 +02:00