Changeset 1489


Ignore:
Timestamp:
Aug 21, 2012, 5:11:20 AM (9 years ago)
Author:
Peter Johansson
Message:

fixes #515. avoid accessing zero-sized vector; reported by Vedran Ljubovic.

Location:
branches/0.9-stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.9-stable/THANKS

    r1090 r1489  
    2222is licensed under GNU GPL <http://www.gnu.org/licenses/>.
    2323
     24Vedran Ljubovic for reporting bug #515
     25
    2426-----------------------------------------------------------------------
    2527{{{
  • branches/0.9-stable/lib/Stats.cc

    r1276 r1489  
    44  Copyright (C) 2005 Peter Johansson
    55  Copyright (C) 2006, 2007, 2008, 2009 Jari Häkkinen, Peter Johansson
    6   Copyright (C) 2010 Peter Johansson
     6  Copyright (C) 2010, 2012 Peter Johansson
    77
    88  This file is part of svndigest, http://dev.thep.lu.se/svndigest
     
    242242    if (iter==m.end() || iter->second.empty())
    243243      return 0;
     244    assert(iter->second.size());
    244245    return iter->second.back();
    245246  }
     
    476477      Colors::instance().get_color(label, r,g,b);
    477478      gp.current_color(r,g,b);
    478       gp.plot(others, label, others.back());
     479      gp.plot(others, label, others.size() ? others.back() : 0);
    479480    }
    480481    for ( ; i!=end; ++i) {
     
    513514    const SumVector& x(get_vector(code_stats(), "all"));
    514515    gp.current_color(255,255,0);
     516    assert(x.size());
    515517    gp.plot(x, "code", x.back());
    516518
    517519    const SumVector& y = get_vector(comment_or_copy_stats(), "all");
    518520    gp.current_color(0,0,255);
     521    assert(y.size());
    519522    gp.plot(y, "comment", y.back());
    520523
    521524    const SumVector& z = get_vector(other_stats(), "all");
    522525    gp.current_color(0,255,0);
     526    assert(z.size());
    523527    gp.plot(z, "other", z.back());
    524528
    525529    gp.current_color(255,0,0);
     530    assert(total.size());
    526531    gp.plot(total, "total", total.back());
    527532  }
Note: See TracChangeset for help on using the changeset viewer.