[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH] net/slirp: Convert atoi to qemu_strtoi to allow err
From: |
Nia Alarie |
Subject: |
[Qemu-devel] [PATCH] net/slirp: Convert atoi to qemu_strtoi to allow error checking |
Date: |
Fri, 16 Mar 2018 14:39:21 +0000 |
Signed-off-by: Nia Alarie <address@hidden>
---
net/slirp.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/slirp.c b/net/slirp.c
index 8991816bbf..e938944bd4 100644
--- a/net/slirp.c
+++ b/net/slirp.c
@@ -486,7 +486,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);
--
2.16.2
- [Qemu-devel] [PATCH] net/slirp: Convert atoi to qemu_strtoi to allow error checking,
Nia Alarie <=