git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@3221 e7ae566f-a301-0410-adde-c780ea21d3b5
james authored on 2008/08/11 12:37:40... | ... |
@@ -156,7 +156,13 @@ lzo_compress (struct buffer *buf, struct buffer work, |
156 | 156 |
{ |
157 | 157 |
ASSERT (buf_init (&work, FRAME_HEADROOM (frame))); |
158 | 158 |
ASSERT (buf_safe (&work, LZO_EXTRA_BUFFER (PAYLOAD_SIZE (frame)))); |
159 |
- ASSERT (buf->len <= PAYLOAD_SIZE (frame)); |
|
159 |
+ |
|
160 |
+ if (!(buf->len <= PAYLOAD_SIZE (frame))) |
|
161 |
+ { |
|
162 |
+ dmsg (D_COMP_ERRORS, "LZO compression buffer overflow"); |
|
163 |
+ buf->len = 0; |
|
164 |
+ return; |
|
165 |
+ } |
|
160 | 166 |
|
161 | 167 |
err = LZO_COMPRESS (BPTR (buf), BLEN (buf), BPTR (&work), &zlen, lzowork->wmem); |
162 | 168 |
if (err != LZO_E_OK) |