chiark
/
gitweb
/
~mdw
/
dvdrip
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
ea027dd
)
dvd-sector-copy.c: Check `n' nonnegative before comparing with unsigned.
author
Mark Wooding
<mdw@distorted.org.uk>
Fri, 18 Feb 2022 22:54:19 +0000
(22:54 +0000)
committer
Mark Wooding
<mdw@distorted.org.uk>
Fri, 18 Feb 2022 22:54:19 +0000
(22:54 +0000)
Otherwise it might be coerced to unsigned, at which point the comparison
means something completely different.
dvd-sector-copy.c
patch
|
blob
|
blame
|
history
diff --git
a/dvd-sector-copy.c
b/dvd-sector-copy.c
index c336d3d2f60500dd7bfb66c8dd574263b2463d42..177ce94f116577887bb351397dcdc5b51a028dcb 100644
(file)
--- a/
dvd-sector-copy.c
+++ b/
dvd-sector-copy.c
@@
-595,7
+595,7
@@
static ssize_t recovery_read(struct recoverybuf *r,
printf(" -> %zd\n", n);
#endif
if (n != nn) {
printf(" -> %zd\n", n);
#endif
if (n != nn) {
- if (n > want) n = want;
+ if (n >
= 0 && n >
want) n = want;
goto end;
}
r->start = pp;
goto end;
}
r->start = pp;