File: mayhem.patch

package info (click to toggle)
epcr 2.3.12-1-9
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, sid
  • size: 916 kB
  • sloc: cpp: 5,730; ansic: 231; makefile: 31; python: 26; sh: 12
file content (27 lines) | stat: -rw-r--r-- 693 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
Author: Andreas Tille <tille@debian.org>
Last-Update: Mon, 21 Dec 2015 11:00:34 +0100
Bug-Debian: http://bugs.debian.org/715850
Description: Fix Mayhem issue

--- a/stsmatch_m.cpp
+++ b/stsmatch_m.cpp
@@ -38,7 +38,7 @@
 #include <errno.h>
 #include <ctype.h>
 #include <stdexcept>
-
+#include <iostream>
 
 USING_NCBI_SCOPE;
 USING_SCOPE(EPCR_SCOPE);
@@ -167,6 +167,10 @@ void CStsFileHash::ReadStsFile(const str
 
 		for(int to_parse=m_MemorySize; to_parse>1; to_parse=end-pos) {
 			const char * nl=strpbrk(pos,"\n\r");
+			if (!nl) {
+				std::cerr << "Unable to find line end in string '" << pos << "'.\n";
+				std::exit(EXIT_FAILURE);
+			}
 
 			if(!ParseLine(cbk,pos,nl-pos)) break;