Changeset 73c15d2 in git


Ignore:
Timestamp:
20/09/11 09:00:05 (8 years ago)
Author:
Olly Betts <olly@…>
Branches:
svn/1.0, svn/tags/1.0.40
Children:
bbc83be
Parents:
da83c18
Message:

Backport change from 1.2.0:
src/mainfrm.cc: Fix potential reading off end of string - fix from
Stuart Bennett.

git-svn-id: file:///home/survex-svn/survex/branches/1.0@3691 4b37db11-9a0c-4f06-9ece-9ab7cdaee568

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ChangeLog

    rda83c18 r73c15d2  
     1Tue Sep 20 07:59:41 GMT 2011  Olly Betts <olly@survex.com>
     2
     3        * Backport change from 1.2.0:
     4        * src/mainfrm.cc: Fix potential reading off end of string - fix from
     5          Stuart Bennett.
     6
    17Tue Sep 20 07:56:18 GMT 2011  Olly Betts <olly@survex.com>
    28
  • src/mainfrm.cc

    rda83c18 r73c15d2  
    829829                // Note that we require a match of a whole number of parts
    830830                // between dots!
    831                 for (size_t i = 0; prefix[i] == current_prefix[i]; ++i) {
     831                size_t n = min(prefix.length(), current_prefix.length());
     832                size_t i;
     833                for (i = 0; i < n && prefix[i] == current_prefix[i]; ++i) {
    832834                    if (prefix[i] == separator) count = i + 1;
    833835                }
Note: See TracChangeset for help on using the changeset viewer.