On Aug 10, 2014, at 20:38, Bram Moolenaar <[email protected]> wrote:

> 
> Patch 7.4.399
> Problem:    Encryption implementation is messy.  Blowfish encryption has a
>           weakness.
> Solution:   Refactor the encryption, store the state in an allocated struct
>           instead of using a save/restore mechanism.  Introduce the
>           "blowfish2" method, which does not have the weakness and encrypts
>           the whole undo file. (largely by David Leadbeater)
> Files:            runtime/doc/editing.txt, runtime/doc/options.txt, 
> src/Makefile,
>           src/blowfish.c, src/crypt.c, src/crypt_zip.c, src/ex_docmd.c,
>           src/fileio.c, src/globals.h, src/main.c, src/memline.c,
>           src/misc2.c, src/option.c, src/proto.h, src/proto/blowfish.pro,
>           src/proto/crypt.pro, src/proto/cr
>           src/proto/fileio.pro, src/proto/misc2.pro, src/structs.h,
>           src/undo.c, src/testdir/test71.in, src/testdir/test71.ok,
>           src/testdir/test71a.in, src/testdir/test72.in,
>           src/testdir/test72.ok

Hi,

On Mac OS X (10.9.4), test72 fails due to a segmentation fault.

Looking into the failure, I found that it was caused by passing uninitialized 
bi.bi_buffer to undo_flush() at undo.c:1785, then undo_flush() invoking 
fwrite() with a null-valued first argument.

While non-null checks against bi_buffer are done here and there in undo.c, 
there is no such a check around undo.c:1785.

Hopefully, the attached patch fixes the issue.

Regards,
Kazunobu Kuriyama

FYI, the OS X environment doesn’t define both HAVE_SELINUX and HAVE_SMACK.  I 
guess that is a cause of bi_buffer’s uninitialization.


Attachment: undo.c.patch
Description: Binary data

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui