x86_64: ensure that dtor pointer passed to app is 0 so it won't be used
authorRich Felker <dalias@aerifal.cx>
Sun, 19 Jun 2011 12:33:27 +0000 (08:33 -0400)
committerRich Felker <dalias@aerifal.cx>
Sun, 19 Jun 2011 12:33:27 +0000 (08:33 -0400)
leaving it uninitialized caused unpredictable crashes or worse due to
calling an indeterminate function pointer.

src/ldso/x86_64/start.s

index efb2745..cb0a9e1 100644 (file)
@@ -5,4 +5,5 @@ _start:
        lea 8(%rsp),%rsi
        lea _GLOBAL_OFFSET_TABLE_(%rip),%rdx
        call __dynlink
+       xor %edx,%edx
        jmp *%rax