From 5acaf006ae54db3c492812acc788a56ec1c0dc99 Mon Sep 17 00:00:00 2001 From: perrynzhou Date: Wed, 5 Jun 2019 14:51:57 +0900 Subject: [PATCH] regx/base: fix an integer overflow use strtol() instead of atoi() in order to handle hostnames containing a large number. This is a one-off commit for the release branches since the regx framework has already been removed from master. Refs. open-mpi/ompi#6729 Signed-off-by: perrynzhou --- orte/mca/regx/base/regx_base_default_fns.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/orte/mca/regx/base/regx_base_default_fns.c b/orte/mca/regx/base/regx_base_default_fns.c index 6b70f78cad..4e1645d16b 100644 --- a/orte/mca/regx/base/regx_base_default_fns.c +++ b/orte/mca/regx/base/regx_base_default_fns.c @@ -1,6 +1,6 @@ /* * Copyright (c) 2016-2018 Intel, Inc. All rights reserved. - * Copyright (c) 2018 Research Organization for Information Science + * Copyright (c) 2018-2019 Research Organization for Information Science * and Technology (RIST). All rights reserved. * $COPYRIGHT$ * @@ -1056,7 +1056,7 @@ static int regex_parse_node_range(char *base, char *range, int num_digits, char for (found = false, i = 0; i < len; ++i) { if (isdigit((int) range[i])) { if (!found) { - start = atoi(range + i); + start = strtol(range + i, NULL, 10); found = true; break; }