summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-ssl.c
diff options
context:
space:
mode:
authorDario Lombardo <lomato@gmail.com>2016-09-29 14:32:03 +0200
committerMichael Mann <mmann78@netscape.net>2016-10-03 14:35:37 +0000
commit542c3c6f3a87ba147dd85f2909270cc2ad320e93 (patch)
tree59c28ad0883ea7f4da1299b6e88454b4d0cc1239 /epan/dissectors/packet-ssl.c
parentb90134f703b897811b62b7cfa89b2800e5b8d541 (diff)
downloadwireshark-542c3c6f3a87ba147dd85f2909270cc2ad320e93.tar.gz
ssl: use ws_strtou function.
Change-Id: I947dc83e3b1b853873b5158f234e44ef933c3bcc Reviewed-on: https://code.wireshark.org/review/17982 Reviewed-by: Peter Wu <peter@lekensteyn.nl> Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-ssl.c')
-rw-r--r--epan/dissectors/packet-ssl.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ssl.c b/epan/dissectors/packet-ssl.c
index f4d3e0426e..c0450dedc2 100644
--- a/epan/dissectors/packet-ssl.c
+++ b/epan/dissectors/packet-ssl.c
@@ -96,6 +96,7 @@
#include <wsutil/utf8_entities.h>
#include <wsutil/str_util.h>
+#include <wsutil/strtoi.h>
#include "packet-tcp.h"
#include "packet-x509af.h"
#include "packet-ocsp.h"
@@ -388,7 +389,8 @@ ssl_cleanup(void)
static void
ssl_parse_uat(void)
{
- guint i, port;
+ guint i;
+ guint16 port;
dissector_handle_t handle;
ssl_set_debug(ssl_debug_file_name);
@@ -418,8 +420,8 @@ ssl_parse_uat(void)
for (i = 0; i < nssldecrypt; i++) {
ssldecrypt_assoc_t *ssl_uat = &(sslkeylist_uats[i]);
ssl_parse_key_list(ssl_uat, ssl_key_hash, "ssl.port", ssl_handle, TRUE);
- if (key_list_stack)
- wmem_stack_push(key_list_stack, GUINT_TO_POINTER(atoi(ssl_uat->port)));
+ if (key_list_stack && ws_strtou16(ssl_uat->port, NULL, &port) && port > 0)
+ wmem_stack_push(key_list_stack, GUINT_TO_POINTER(port));
}
}