Ticket #872: valgrind-bookmarks-zeroing-offsets.patch

File valgrind-bookmarks-zeroing-offsets.patch, 655 bytes (added by pini, 11 years ago)
  • navit/bookmarks.c

    Description: Fix an uninitialized read error reported by valgrind
    Author: Gilles Filippini <pini@debian.org>
    Forwarded: http://trac.navit-project.org/ticket/872
    Last-Update: 2011-05-30
    old new  
    670670                int offset_pos=0;
    671671                int offset;
    672672                char buffer[4096];
    673                 memset(offsets, 0, sizeof(offsets));
     673                memset(offsets, 0, sizeof(int)*limit);
    674674                for (;;) {
    675675                        offset=ftell(f);
    676676                        if (!fgets(buffer, sizeof(buffer), f))