From: semarie Date: Sun, 10 Jul 2016 14:21:24 +0000 (+0000) Subject: pledge: use uint64_t instead of int for temporary storing a 64bit integer X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=6aabbe278a14cf49277be3ca36954938391fdb7a;p=openbsd pledge: use uint64_t instead of int for temporary storing a 64bit integer affects only 32 bits platform (like i386). problem spotted and diff from pelikan@ ok deraadt@ jca@ --- diff --git a/sys/kern/kern_pledge.c b/sys/kern/kern_pledge.c index 2d254dcbba4..45ce0bc1c35 100644 --- a/sys/kern/kern_pledge.c +++ b/sys/kern/kern_pledge.c @@ -1,4 +1,4 @@ -/* $OpenBSD: kern_pledge.c,v 1.175 2016/07/10 00:39:23 guenther Exp $ */ +/* $OpenBSD: kern_pledge.c,v 1.176 2016/07/10 14:21:24 semarie Exp $ */ /* * Copyright (c) 2015 Nicholas Marriott @@ -79,7 +79,7 @@ #include "drm.h" #endif -int pledgereq_flags(const char *req); +uint64_t pledgereq_flags(const char *req); int canonpath(const char *input, char *buf, size_t bufsize); int substrcmp(const char *p1, size_t s1, const char *p2, size_t s2); int resolvpath(struct proc *p, char **rdir, size_t *rdirlen, char **cwd, @@ -404,7 +404,7 @@ sys_pledge(struct proc *p, void *v, register_t *retval) if (SCARG(uap, request)) { size_t rbuflen; char *rbuf, *rp, *pn; - int f; + uint64_t f; rbuf = malloc(MAXPATHLEN, M_TEMP, M_WAITOK); error = copyinstr(SCARG(uap, request), rbuf, MAXPATHLEN, @@ -1515,7 +1515,7 @@ pledge_swapctl(struct proc *p) } /* bsearch over pledgereq. return flags value if found, 0 else */ -int +uint64_t pledgereq_flags(const char *req_name) { int base = 0, cmp, i, lim;