diff options
author | Rob Landley <rob@landley.net> | 2018-09-16 14:17:09 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2018-09-16 14:17:09 -0500 |
commit | 19f7ad4949e12fa667b448b01a5b703ac6d926de (patch) | |
tree | f07e6d6afd6f95db12afc170198ffbd73cdf1e38 | |
parent | ca595ca6cd08ddfef5023e40245b616e78e1faa1 (diff) | |
download | toybox-19f7ad4949e12fa667b448b01a5b703ac6d926de.tar.gz |
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.
-rw-r--r-- | main.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -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; |