From 4b81ec76d1415ab2ab863e2553d3ddee4b7aed4f Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Wed, 15 Jul 1998 04:03:54 +0000 Subject: [PATCH] Cast the value returned by strtoul() to a uintptr_t before casting it to a pointer. There's nothing better than strtoul() for reading pointers from strings, but the range checking should be better. --- sys/i386/i386/userconfig.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 3bfc5868bcf4..10a755f950ab 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -46,7 +46,7 @@ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** $Id: userconfig.c,v 1.102 1998/02/10 00:10:35 msmith Exp $ + ** $Id: userconfig.c,v 1.103 1998/03/10 08:03:47 jkh Exp $ **/ /** @@ -2379,7 +2379,7 @@ visuserconfig(void) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.102 1998/02/10 00:10:35 msmith Exp $ + * $Id: userconfig.c,v 1.103 1998/03/10 08:03:47 jkh Exp $ */ #include "scbus.h" @@ -2623,7 +2623,7 @@ parse_args(char *cmd, CmdParm *parms) continue; } if (parms->type == PARM_ADDR) { - parms->parm.aparm = (void *)strtoul(cmd, &ptr, 0); + parms->parm.aparm = (void *)(uintptr_t)strtoul(cmd, &ptr, 0); if (cmd == ptr) { printf("Invalid address argument\n"); return 1;