Bug 1192844: Accept 0xCC padding in WindowsDllDetourPatcher::CreateTrampoline. r=m_kato
authorDavid Major <dmajor@mozilla.com>
Wed, 12 Aug 2015 13:10:04 -0400
changeset 291787 5e520f58ae3956a271bdfb1cb8ff24f871a4106f
parent 291786 74ec3ff61daaffbe5bb30c7dde09e292be87b66e
child 291788 5703e8fcf3825d8d41e31a9731600d0ce421add3
push id962
push userjlund@mozilla.com
push dateFri, 04 Dec 2015 23:28:54 +0000
treeherdermozilla-release@23a2d286e80f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersm_kato
bugs1192844
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1192844: Accept 0xCC padding in WindowsDllDetourPatcher::CreateTrampoline. r=m_kato
xpcom/build/nsWindowsDllInterceptor.h
--- a/xpcom/build/nsWindowsDllInterceptor.h
+++ b/xpcom/build/nsWindowsDllInterceptor.h
@@ -422,23 +422,23 @@ protected:
         return;
       }
     }
 #elif defined(_M_X64)
     byteptr_t directJmpAddr;
 
     while (nBytes < 13) {
 
-      // if found JMP 32bit offset, next bytes must be NOP
+      // if found JMP 32bit offset, next bytes must be NOP or INT3
       if (pJmp32 >= 0) {
-        if (origBytes[nBytes++] != 0x90) {
-          return;
+        if (origBytes[nBytes] == 0x90 || origBytes[nBytes] == 0xcc) {
+          nBytes++;
+          continue;
         }
-
-        continue;
+        return;
       }
       if (origBytes[nBytes] == 0x0f) {
         nBytes++;
         if (origBytes[nBytes] == 0x1f) {
           // nop (multibyte)
           nBytes++;
           if ((origBytes[nBytes] & 0xc0) == 0x40 &&
               (origBytes[nBytes] & 0x7) == 0x04) {