On Friday, 3 August 2007 01:24, Alon Bar-Lev wrote:
> On 8/3/07, Rafael J. Wysocki <[EMAIL PROTECTED]> wrote:
> > Please look at the code in prepare(), for example.  In there, 
> > lzf_compress() is
> > used to take page_size bytes of data from buf, compress them and place the
> > result under the address block->data, with the assumption that the size of 
> > the
> > result will be _less_ than page_size (otherwise, plain memcpy() is used).  I
> > think you should be able to do something like this with lzo1x_1_compress().
> 
> You cannot do this as the lzo1x_1_compress() does not test for buffer
> overflow for target.

Too bad.

> So you must give it a buffer large enough...
> We can make sure that the output buffer is always in the right size,
> then the memcpy is not needed.

And we should do that if we want to use lzo, but this means more invasive
patch would be necessary.

It will have to wait until I can take care of it, sorry.

> > BTW, how exactly does lzo1x_1_compress() work?
> 
> What do you mean?

What's the meaning of arguments etc.

> http://www.oberhumer.com/opensource/lzo/lzodoc.php
> 
> The package has some documentation and a lot of examples...

Well, I was hoping not to have to go through the documentation.

Anyway, as I said above, this is more complicated than it seemed.

Greetings,
Rafael


-- 
"Premature optimization is the root of all evil." - Donald Knuth

-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Suspend-devel mailing list
Suspend-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/suspend-devel

Reply via email to