diff options
author | Simon Tatham <anakin@pobox.com> | 2017-05-18 06:57:29 +0100 |
---|---|---|
committer | Simon Tatham <anakin@pobox.com> | 2017-05-18 06:57:29 +0100 |
commit | 69d886c5757e405785ce811d8622f4ff189a9514 (patch) | |
tree | 396774d1e4b25a88e0c23710bf7f5a94a3ee6cdf /fake-lib.c | |
parent | 7e5c5d42320ab39cd8f7d0d181745786196cb0b8 (diff) | |
download | wix-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.c | 12 |
1 files changed, 0 insertions, 12 deletions
@@ -113,15 +113,3 @@ char *dupcat(const char *str, ...) | |||
113 | 113 | ||
114 | return out; | 114 | return out; |
115 | } | 115 | } |
116 | |||
117 | unsigned 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 | } | ||