[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#160761: install-info: endless loop



Package: dpkg
Version: 1.9.21
Severity: important

The problem is on line 253:

249:    open(OLD,"$infodir/dir") || &ulquit("open $infodir/dir: $!");
250:    @work= <OLD>;
251:    eof(OLD) || &ulquit("read $infodir/dir: $!");
252:    close(OLD) || &ulquit("close $infodir/dir after read: $!");
253==>  while ($work[$#work] !~ m/\S/) { $#work--; }
254
255:    while (@work) {
256:        $_= shift(@work);
257:        push(@head,$_);
258:        last if (m/^\*\s*Menu:/i);
259     }

If $infodir/dir is an empty file, the while loop on line 253 will go on
forever. $#work needs to be checked before using $work[$#work].


/Cristian

-- System Information
Debian Release: 3.0
Architecture: i386
Kernel: Linux my-box 2.4.19 #1 Sat Aug 24 16:15:43 CEST 2002 i686
Locale: LANG=C, LC_CTYPE=

Versions of packages dpkg depends on:
ii  libc6                    2.2.5-11.1      GNU C Library: Shared libraries an
ii  libncurses5              5.2.20020112a-7 Shared libraries for terminal hand
ii  libstdc++2.10-glibc2.2   1:2.95.4-7      The GNU stdc++ library




Reply to: