stream-client: check read() return value before using it as length input to memcpy
Change-Id: Id962821c71b3a1c4c01c1131eb809b8ec8eaa062 Fixes: Coverity CID 57859
This commit is contained in:
parent
a47c8a3f3f
commit
e63f88146d
|
@ -72,8 +72,9 @@ static int kbd_cb(struct osmo_fd *fd, unsigned int what)
|
|||
int ret;
|
||||
|
||||
ret = read(STDIN_FILENO, buf, sizeof(buf));
|
||||
|
||||
LOGP(DSTREAMTEST, LOGL_NOTICE, "read %d byte from keyboard\n", ret);
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
msg = msgb_alloc(1024, "STREAMCLIENT/test");
|
||||
if (msg == NULL) {
|
||||
|
|
Loading…
Reference in New Issue