Commit ac2e13b9 authored by Flavio Ceolin's avatar Flavio Ceolin Committed by Carles Cufi
Browse files

net: tcp: Fix possible buffer underflow

Fix possible underflow in tcp flags parse.

Signed-off-by: default avatarFlavio Ceolin <flavio.ceolin@intel.com>
parent 8148449d
Loading
Loading
Loading
Loading
+2 −0
Changes for subsys/net/ip/tcp.c: 2 added lines, 0 removed lines.
Original line number Diff line number Diff line
@@ -238,8 +238,10 @@ static const char *tcp_flags(uint8_t flags)
			len += snprintk(buf + len, BUF_SIZE - len, "URG,");
		}

		if (len > 0) {
			buf[len - 1] = '\0'; /* delete the last comma */
		}
	}
#undef BUF_SIZE
	return buf;
}