mirror of https://github.com/ericonr/sndio.git
panic() if read buffer overruns
This commit is contained in:
parent
c3b7829b02
commit
10bd2bb48a
|
@ -499,6 +499,17 @@ sock_rdata(struct sock *f)
|
||||||
buf = &f->midi->ibuf;
|
buf = &f->midi->ibuf;
|
||||||
|
|
||||||
data = abuf_wgetblk(buf, &count) + f->rsize - f->rtodo;
|
data = abuf_wgetblk(buf, &count) + f->rsize - f->rtodo;
|
||||||
|
#ifdef DEBUG
|
||||||
|
/*
|
||||||
|
* XXX: this can happen in MIDIOUT mode, since we dont
|
||||||
|
* have flow control
|
||||||
|
*/
|
||||||
|
if (count < f->rtodo) {
|
||||||
|
sock_log(f);
|
||||||
|
log_puts(": data read buffer overrun\n");
|
||||||
|
panic();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
n = read(f->fd, data, f->rtodo);
|
n = read(f->fd, data, f->rtodo);
|
||||||
if (n < 0) {
|
if (n < 0) {
|
||||||
if (errno == EFAULT) {
|
if (errno == EFAULT) {
|
||||||
|
|
Loading…
Reference in New Issue