From 19f7ad4949e12fa667b448b01a5b703ac6d926de Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Sun, 16 Sep 2018 14:17:09 -0500 Subject: It should never matter on Linux (where the top half of virtual address space is reserved for the kernel), but technically a pointer is unsigned long. --- main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index c22ff6e5..2d6cc2f8 100644 --- a/main.c +++ b/main.c @@ -156,8 +156,8 @@ void toy_exec_which(struct toy_list *which, char *argv[]) // Compiler writers have decided subtracting char * is undefined behavior, // so convert to integers. (LP64 says sizeof(long)==sizeof(pointer).) - if (!CFG_TOYBOX_NORECURSE) - if (toys.stacktop && labs((long)toys.stacktop-(long)&which)>6000) return; + if (!CFG_TOYBOX_NORECURSE && toys.stacktop) + if (labs((unsigned long)toys.stacktop-(unsigned long)&which)>6000) return; // Return if we need to re-exec to acquire root via suid bit. if (toys.which && (which->flags&TOYFLAG_ROOTONLY) && toys.wasroot) return; -- cgit v1.2.3