File: avoid-unaligned-integer-access.patch

package info (click to toggle)
fim 0.7.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,048 kB
  • sloc: cpp: 32,769; ansic: 4,507; makefile: 1,549; sh: 1,502; perl: 189; exp: 28; awk: 9
file content (13 lines) | stat: -rw-r--r-- 705 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
Description: Avoid unaligned integer access on big endian
Author: Michele Martone <michelemartone@users.sourceforge.net>
Bug-Debian: https://bugs.debian.org/1120344
Last-Update: 2025-11-16

--- fim-0.7.0.orig/src/fim_interpreter.cpp
+++ fim-0.7.0/src/fim_interpreter.cpp
@@ -497,3 +497,4 @@
 	if( *reinterpret_cast<int*>(s+0) == 0x72616e64 // rand
-	&& (*reinterpret_cast<int*>(s+3))== 0x646f6d00    ) // dom. // access legal bytes
+	// && (*reinterpret_cast<int*>(s+3))== 0x646f6d00    ) // dom. // access legal bytes
+	&& s[4]=='o' && s[5]=='m' && !s[6]) // om. // access legal bytes avoiding unaligned int access
 	//&& (*reinterpret_cast<int*>(s+4)<<8)== 0x006f6d00    ) // .om. // eight byte illegal