Explorar el Código

regex: call memcpy() ourselves

Call the hidden memcpy() ourselves otherwise gcc will emit a call to the
public memcpy() which goes through the PLT.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Mike Frysinger hace 16 años
padre
commit
3aa584adcf
Se han modificado 1 ficheros con 2 adiciones y 1 borrados
  1. 2 1
      libc/misc/regex/regex_old.c

+ 2 - 1
libc/misc/regex/regex_old.c

@@ -8085,7 +8085,8 @@ regexec (
   int len = strlen (string);
   boolean want_reg_info = !preg->no_sub && nmatch > 0;
 
-  private_preg = *preg;
+  /* use hidden memcpy() ourselves rather than gcc calling public memcpy() */
+  memcpy(&private_preg, preg, sizeof(*preg));
 
   private_preg.not_bol = !!(eflags & REG_NOTBOL);
   private_preg.not_eol = !!(eflags & REG_NOTEOL);