summaryrefslogtreecommitdiffstats
path: root/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'kernel')
-rw-r--r--kernel/kls_hdr/fmt_codec_hdr.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/kernel/kls_hdr/fmt_codec_hdr.cpp b/kernel/kls_hdr/fmt_codec_hdr.cpp
index 9819504..33af0a0 100644
--- a/kernel/kls_hdr/fmt_codec_hdr.cpp
+++ b/kernel/kls_hdr/fmt_codec_hdr.cpp
@@ -283,7 +283,8 @@ bool fmt_codec::getHdrHead()
bool done = false;
s8 a, b;
s8 x[2], y[2];
- s8 buff[80];
+ const u32 buffSize = 80;
+ s8 buff[buffSize];
u32 count = 0;
if(!frs.readK(hdr.sig, sizeof(hdr.sig)-1)) return false;
@@ -320,6 +321,9 @@ bool fmt_codec::getHdrHead()
if(!frs.readK(&a, sizeof(s8))) return false;
++count;
+ if (count > buffSize-1) {
+ return false;
+ }
}
buff[count] = '\0';