Commit 4ed6ed0
net: tcp: Be more careful before dereferencing pointer in accept()
The function net_context_accept() was dereferencing context->tcp
without asserting it's not NULL, even if the protocol was not TCP.
There's a check prior to that to ensure it's a SOCK_STREAM, but that
wasn't sufficient to ensure that the pointer wouldn't be dereferenced
even if invalid.
Change-Id: Ie4f6b9792f6ebb90198ba3a845bb1b83ac450c38
Signed-off-by: Leandro Pereira <leandro.pereira@intel.com>1 parent 777cd07 commit 4ed6ed0
1 file changed
+8
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1252 | 1252 | | |
1253 | 1253 | | |
1254 | 1254 | | |
1255 | | - | |
1256 | | - | |
1257 | | - | |
1258 | | - | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
| 1258 | + | |
| 1259 | + | |
| 1260 | + | |
| 1261 | + | |
| 1262 | + | |
1259 | 1263 | | |
1260 | 1264 | | |
1261 | 1265 | | |
| |||
0 commit comments