Menu

#451 dir_reader::matches uses iterator that is at end

2.0 Series
closed-fixed
General (291)
5
2006-03-02
2006-02-14
No

NSIS 2.06

When I ran the NSIS compiler in my VS2005 debugging
environment I got an assertion in source dirreader.cpp
method dirreader::matches when I wanted to install the
file 'Microsoft.VC80.DebugCRT.manifest'.

In the while loop the iterator 'spec_itr' is
dereferenced before it it checked against 'spec_end'.

Fix option 1 (simple): changed the order of evaluation
in the while clause.

Fix option 2 (better): implement it as specified in the
attachment.

Discussion

  • vapour_it_alley

    vapour_it_alley - 2006-02-15
     
  • Amir Szekely

    Amir Szekely - 2006-02-24

    Logged In: YES
    user_id=584402

    Thanks, fixed.

     
  • Amir Szekely

    Amir Szekely - 2006-02-24
    • labels: --> General
    • assigned_to: nobody --> kichik
    • status: open --> closed-fixed
     
  • vapour_it_alley

    vapour_it_alley - 2006-02-26

    Logged In: YES
    user_id=1356798

    Hi Amir,

    Sorry that I have to reopen this bug. But you've not fixed
    the actual problem: never de-reference an iterator that is
    not valid. When an iterator is at the end then is by
    definition not a valid entry so re-referencing is not allowed.

    My attached sample code I in my humble opinion a short but
    correct implementation of the algorithm.

     
  • vapour_it_alley

    vapour_it_alley - 2006-02-26
    • status: closed-fixed --> open-fixed
     
  • Amir Szekely

    Amir Szekely - 2006-02-28

    Logged In: YES
    user_id=584402

    I don't understand where the problem is. The pointer is
    advanced and is immediately validated. The loop expression,
    which dereferences the pointer is not reached unless the
    pointer is valid.

     
  • vapour_it_alley

    vapour_it_alley - 2006-03-02

    Logged In: YES
    user_id=1356798

    Amir,

    You're absolutely right. It is obvious I did not look into
    your fix with enough attention before reacting on it.

    Keep up the great work you're doing. We did away with Wise
    in favour of NSIS for our GE Centricity Enterprise
    Archive: GE's Healthcare imaging storage solution used in
    hundreds of hospitals all over the world.

    See also:
    http://www.gehealthcare.com/usen/img_info_systems/products/
    censtorage.html

     
  • vapour_it_alley

    vapour_it_alley - 2006-03-02
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.