From f7b29f23ad06403673a44915d5d85b09da69857a Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Thu, 14 Sep 2006 16:08:13 +0000 Subject: r18528: work around what appears to be a compiler bug in gcc on irix. It caused the RPC-SECRETS test to crash smbd in an inlined version of this memcmp() call. This patch should have absolutely no effect at all, but in fact it prevents the crash. Disassembling at the point of the crash, it shows that gcc is inlining the memcmp(). I don't know enough MIPS assembler to actually spot the bug. In case anyone reading this does know MIPS assembler, here is the gcc generated code that crashes: 0x105e0218 : lw $t1,52($sp) 0x105e021c : lw $t1,0($t1) 0x105e0220 : lhu $t1,0($t1) 0x105e0224 : lw $t2,68($sp) 0x105e0228 : lhu $t2,0($t2) 0x105e022c : subu $t1,$t1,$t2 it gets a segv at 0x105e0220. lha, what do you think of this? The change should be innocuous on all other platforms, apart from making the code harder to read :( (This used to be commit 95455b57893c99d6d2dc20c4f75042ae4c1cfe85) --- source4/heimdal/lib/gssapi/decapsulate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source4/heimdal/lib') diff --git a/source4/heimdal/lib/gssapi/decapsulate.c b/source4/heimdal/lib/gssapi/decapsulate.c index 90e037f09b..08df361776 100644 --- a/source4/heimdal/lib/gssapi/decapsulate.c +++ b/source4/heimdal/lib/gssapi/decapsulate.c @@ -110,7 +110,7 @@ gssapi_krb5_verify_header(u_char **str, if (len < 2) return GSS_S_DEFECTIVE_TOKEN; - if (memcmp (*str, type, 2) != 0) + if ((*str)[0] != type[0] || (*str)[1] != type[1]) return GSS_S_DEFECTIVE_TOKEN; *str += 2; -- cgit