----- Original Message -----
>To: Kazunobu Kuriyama <[email protected]>
>Subject: Re: Patch 7.4.399
>Cc: [email protected]
>From: Bram Moolenaar <[email protected]>
>Date: Mon, 11 Aug 2014 10:51:31 +0200
>
>
>
>Kazunobu Kuriyama 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 stru
ct
>> >        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.
>
>Sorry!
>
>> 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.
>
>I think the structure should be initialized to zeroes to avoid
>surprises.

I should admit my previous post was misleading. The problem has nothing to do 
with the initialisation. Rather, I should have said 'allocation': For Mac OS X
, the field variable bi_buffer which had set to null at the beginning of u_wri
te_undo(), was not made a valid pointer before passing it to undo_flush(). The
 null-valued bi_buffer caused a segfault at fwrite() invoked in undo_flush().

>
>> 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.
>
>We don't want these complications, to clearing it completely is better.

I don't intend to ask anyone for doing anything with it. I only wanted to say 
that the code relevant to selinux or smack cannot be checked on my side in cas
e the proposed patch goes wrong.

>
>
>-- 
>hundred-and-one symptoms of being an internet addict:
>26. You check your mail. It says "no new messages." So you check it again.
>
> /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   ¥¥¥
>///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ¥¥¥
>¥¥¥  an exciting new programming language -- http://www.Zimbu.org        ///
> ¥¥¥            help me help AIDS victims -- http://ICCF-Holland.org    ///
>
>-- 
>-- 
>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 "vi
m_dev" group.
>To unsubscribe from this group and stop receiving emails from it, send an ema
il to [email protected].
>For more options, visit https://groups.google.com/d/optout.

-- 
-- 
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