projects
/
project
/
luci.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
18b637f
)
luci-base: http.uc: fix eof detection in temporary upload files
author
Jo-Philipp Wich
<jo@mein.io>
Mon, 21 Aug 2023 14:37:11 +0000
(16:37 +0200)
committer
Jo-Philipp Wich
<jo@mein.io>
Mon, 21 Aug 2023 14:37:11 +0000
(16:37 +0200)
Binary string comparisons in ucode are currently unsafe, so use the
`length()` function to determine the just read data chunk size in
order to test for end of file.
Fixes: #6530
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
modules/luci-base/ucode/http.uc
patch
|
blob
|
history
diff --git
a/modules/luci-base/ucode/http.uc
b/modules/luci-base/ucode/http.uc
index 579dda3cedcaaa0bd625cace3c685de6fc67a069..e7f64ae6e9fe00bd1981518927565829a14b11ba 100644
(file)
--- a/
modules/luci-base/ucode/http.uc
+++ b/
modules/luci-base/ucode/http.uc
@@
-430,7
+430,7
@@
const Class = {
for (let name, value in this.message.params) {
while (value?.fd) {
let data = value.fd.read(1024);
- let eof = (
data == null || data == ''
);
+ let eof = (
length(data) == 0
);
this.filehandler(value, data, eof);