summaryrefslogtreecommitdiffstats
path: root/js/src/jsfun.cpp
diff options
context:
space:
mode:
authorwolfbeast <mcwerewolf@gmail.com>2018-01-26 21:26:07 +0100
committerwolfbeast <mcwerewolf@gmail.com>2018-02-08 23:32:18 +0100
commit91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6 (patch)
treebddbc08072e3baefc28563eecaa70251f56b19c6 /js/src/jsfun.cpp
parenta8d25a2ed6e6306fb073578158572b04749f7891 (diff)
downloadUXP-91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6.tar
UXP-91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6.tar.gz
UXP-91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6.tar.lz
UXP-91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6.tar.xz
UXP-91d9f5d658d646e1ad1c0b3a28a9bba0094a44c6.zip
Make XDR decoding more robust.
Diffstat (limited to 'js/src/jsfun.cpp')
-rw-r--r--js/src/jsfun.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/js/src/jsfun.cpp b/js/src/jsfun.cpp
index 9fffce448..c952441ad 100644
--- a/js/src/jsfun.cpp
+++ b/js/src/jsfun.cpp
@@ -641,6 +641,10 @@ js::XDRInterpretedFunction(XDRState<mode>* xdr, HandleScope enclosingScope,
objp.set(fun);
}
+ // Verify marker at end of function to detect buffer truncation.
+ if (!xdr->codeMarker(0xA0129CD1))
+ return false;
+
return true;
}