From: Mark Wooding Date: Sat, 19 Feb 2022 11:53:22 +0000 (+0000) Subject: dvd-sector-copy.c: Limit `recovery_read' return value to length requested. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~mdw/git/dvdrip/commitdiff_plain/d1105ba703454450ea52af0a22a6b3ac9d355436 dvd-sector-copy.c: Limit `recovery_read' return value to length requested. Otherwise the caller gets properly confused. --- diff --git a/dvd-sector-copy.c b/dvd-sector-copy.c index 4d44122..86540e0 100644 --- a/dvd-sector-copy.c +++ b/dvd-sector-copy.c @@ -663,6 +663,7 @@ static ssize_t recovery_read(struct recoverybuf *r, n = r->pos + r->end - pos; if (!n && want) n = -1; + else if (n > want) n = want; end: #ifdef DEBUG