projects
/
linux.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2034a42
)
rslib: decode_rs: Fix length parameter check
author
Ferdinand Blomqvist
<ferdinand.blomqvist@gmail.com>
Thu, 20 Jun 2019 14:10:35 +0000
(17:10 +0300)
committer
Thomas Gleixner
<tglx@linutronix.de>
Wed, 26 Jun 2019 12:55:46 +0000
(14:55 +0200)
The length of the data load must be at least one. Or in other words,
there must be room for at least 1 data and nroots parity symbols after
shortening the RS code.
Signed-off-by: Ferdinand Blomqvist <ferdinand.blomqvist@gmail.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Link:
https://lkml.kernel.org/r/20190620141039.9874-4-ferdinand.blomqvist@gmail.com
lib/reed_solomon/decode_rs.c
patch
|
blob
|
history
diff --git
a/lib/reed_solomon/decode_rs.c
b/lib/reed_solomon/decode_rs.c
index 3313bf944ff142ecf7fd24a274ed52dd98ca4d81..22006eaa41e65c28bd89a9fbfb9ed111032487f6 100644
(file)
--- a/
lib/reed_solomon/decode_rs.c
+++ b/
lib/reed_solomon/decode_rs.c
@@
-39,7
+39,7
@@
/* Check length parameter for validity */
pad = nn - nroots - len;
- BUG_ON(pad < 0 || pad >= nn);
+ BUG_ON(pad < 0 || pad >= nn
- nroots
);
/* Does the caller provide the syndrome ? */
if (s != NULL)