diff options
author | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2014-05-04 01:18:47 -0400 |
---|---|---|
committer | Olivier CrĂȘte <olivier.crete@ocrete.ca> | 2014-05-04 01:18:47 -0400 |
commit | 587f35ea8e3126c00b6c4e33e67277a60c3d45ba (patch) | |
tree | 7ccd55a35c3d365d48d396e4130253eecadd2a2e | |
parent | 3aec0fb8ec87299835987266fed208f5267bb000 (diff) | |
download | farstream-587f35ea8e3126c00b6c4e33e67277a60c3d45ba.tar.gz |
msnconnection: Double check return value of recv()
Even though it has already been peeked at!
-rw-r--r-- | gst/fsmsnconference/fs-msn-connection.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/gst/fsmsnconference/fs-msn-connection.c b/gst/fsmsnconference/fs-msn-connection.c index b10619aa..3504dce0 100644 --- a/gst/fsmsnconference/fs-msn-connection.c +++ b/gst/fsmsnconference/fs-msn-connection.c @@ -788,7 +788,12 @@ connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd) if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0) { GST_DEBUG ("connection successful"); - recv (pollfd->pollfd.fd, str, 13, 0); + if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) + { + GST_WARNING ("Could not read 13 bytes that had previously" + " been peeked at!"): + goto error; + } pollfd->status = FS_MSN_STATUS_CONNECTED2; pollfd->want_write = TRUE; gst_poll_fd_ctl_write (self->poll, &pollfd->pollfd, TRUE); @@ -830,8 +835,10 @@ connection_cb (FsMsnConnection *self, FsMsnPollFD *pollfd) if (size == 13 && strcmp (str, "connected\r\n\r\n") == 0) { GST_DEBUG ("connection successful"); - if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) { - GST_WARNING ("could not read token"); + if (recv (pollfd->pollfd.fd, str, 13, 0) != 13) + { + GST_WARNING ("Could not read 13 bytes that had previously" + " been peeked at!"): goto error; } |