aboutsummaryrefslogtreecommitdiff
path: root/fake-lib.c
diff options
context:
space:
mode:
authorSimon Tatham <anakin@pobox.com>2017-05-18 06:57:29 +0100
committerSimon Tatham <anakin@pobox.com>2017-05-18 06:57:29 +0100
commit69d886c5757e405785ce811d8622f4ff189a9514 (patch)
tree396774d1e4b25a88e0c23710bf7f5a94a3ee6cdf /fake-lib.c
parent7e5c5d42320ab39cd8f7d0d181745786196cb0b8 (diff)
downloadwix-on-linux-69d886c5757e405785ce811d8622f4ff189a9514.tar.gz
wix-on-linux-69d886c5757e405785ce811d8622f4ff189a9514.tar.bz2
wix-on-linux-69d886c5757e405785ce811d8622f4ff189a9514.zip
Redo the bounds checks in MsiGetFileVersion.
Now any failing bounds check causes the whole function to fail, rather than returning a made-up value.
Diffstat (limited to 'fake-lib.c')
-rw-r--r--fake-lib.c12
1 files changed, 0 insertions, 12 deletions
diff --git a/fake-lib.c b/fake-lib.c
index 9862020..36c6198 100644
--- a/fake-lib.c
+++ b/fake-lib.c
@@ -113,15 +113,3 @@ char *dupcat(const char *str, ...)
113 113
114 return out; 114 return out;
115} 115}
116
117unsigned le(const unsigned char *buf, size_t len, size_t off, size_t nbytes)
118{
119 unsigned toret = 0;
120 off += nbytes;
121 while (nbytes-- > 0) {
122 toret <<= 8;
123 if (--off < len)
124 toret |= buf[off];
125 }
126 return toret;
127}