summaryrefslogtreecommitdiff
blob: fcd60f916acd7200cfc6817a6a8b0f62ba9c3a81 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
From: Robert Buchholz <rbu@gentoo.org>
Subject: Fix IndexError that occurs when there is whitespace at the end of the file

Origin: vendor, http://sources.gentoo.org/viewcvs.py/gentoo-x86/dev-util/flawfinder/files/flawfinder-1.27-whitespace-traceback.patch
Bug: http://sourceforge.net/tracker/index.php?func=detail&aid=1834743&group_id=186989&atid=919499

--- flawfinder.orig	2009-09-29 13:55:15.433911571 +0200
+++ flawfinder	2009-09-29 13:56:03.114786154 +0200
@@ -1299,6 +1299,8 @@
     m = p_whitespace.match(text,i)
     if m:
       i = m.end(0)
+      if i >= len(text):
+        break
 
     c = text[i]
     if linebegin:  # If at beginning of line, see if #include is there.