aboutsummaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorNia Alarie <nia.alarie@gmail.com>2018-03-16 14:39:21 +0000
committerSamuel Thibault <samuel.thibault@ens-lyon.org>2018-05-31 21:19:24 +0200
commit1fb3f7f285606c3af2b58cac52f47e9927a5ebea (patch)
tree74bcebb9be56078acf49f465d4068886a5e49e83 /net
parent8ee2022b44e5bbc5360513957790c656824eec55 (diff)
downloadqemu-1fb3f7f285606c3af2b58cac52f47e9927a5ebea.zip
qemu-1fb3f7f285606c3af2b58cac52f47e9927a5ebea.tar.gz
qemu-1fb3f7f285606c3af2b58cac52f47e9927a5ebea.tar.bz2
net/slirp: Convert atoi to qemu_strtoi to allow error checking
Signed-off-by: Nia Alarie <nia.alarie@gmail.com> Signed-off-by: Samuel Thibault <samuel.thibault@ens-lyon.org>
Diffstat (limited to 'net')
-rw-r--r--net/slirp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/net/slirp.c b/net/slirp.c
index 005c267..1e14318 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -492,7 +492,9 @@ void hmp_hostfwd_remove(Monitor *mon, const QDict *qdict)
goto fail_syntax;
}
- host_port = atoi(p);
+ if (qemu_strtoi(p, NULL, 10, &host_port)) {
+ goto fail_syntax;
+ }
err = slirp_remove_hostfwd(s->slirp, is_udp, host_addr, host_port);