Blob Blame History Raw
From 90b65d0e05faee00c42cd303dd155dd3d228553d Mon Sep 17 00:00:00 2001
From: Serhei Makarov <smakarov@redhat.com>
Date: Fri, 9 Nov 2018 16:19:17 -0500
Subject: [PATCH 24/32] PR23860 bugfix: incorrect comparison direction in
 string_copy()

(Turns out this branch was flipped and it was a root cause of the havoc.)

* bpf-translate.cxx (bpf_unparser::emit_string_copy): Correct
  direction of JEQ(all_nz,0) jump instruction.
---
 bpf-translate.cxx | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bpf-translate.cxx b/bpf-translate.cxx
index 57a4cb107..0181380b7 100644
--- a/bpf-translate.cxx
+++ b/bpf-translate.cxx
@@ -2667,7 +2667,7 @@ bpf_unparser::emit_string_copy(value *dest, int ofs, value *src, bool zero_pad)
         }
 
       this_prog.mk_jcond(this_ins, EQ, all_nz, this_prog.new_imm(0),
-                         next_block, zero_pad ? block_B[i+1] : join_block);
+                         zero_pad ? block_B[i+1] : join_block, next_block);
     }
 
   // XXX: Zero-padding is only used under specific circumstances;
-- 
2.14.5