aboutsummaryrefslogtreecommitdiffstats
path: root/extcap
diff options
context:
space:
mode:
authorAlexis La Goutte <alexis.lagoutte@gmail.com>2015-05-22 17:35:20 +0200
committerAlexis La Goutte <alexis.lagoutte@gmail.com>2015-05-28 15:10:33 +0000
commitabfd44571ca7d58da6b77ae45d72ecf58c8c2bd5 (patch)
tree8583c0d85acf1707d00e9baf96a7554b9487027c /extcap
parent187e8f61dcea08b2db8f7cf78102b4c0eaa8e3a0 (diff)
Androiddump: fix Null pointer passed as an argument to a 'nonnull' parameter
Change-Id: I8fbcac112d0b60e0129ce0fc17a5e0ffab02710f Reviewed-on: https://code.wireshark.org/review/8589 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Diffstat (limited to 'extcap')
-rw-r--r--extcap/androiddump.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/extcap/androiddump.c b/extcap/androiddump.c
index d12c8f9d5f..3a766675d0 100644
--- a/extcap/androiddump.c
+++ b/extcap/androiddump.c
@@ -2221,6 +2221,10 @@ int main(int argc, char **argv) {
break;
case OPT_CONFIG_ADB_SERVER_TCP_PORT:
adb_server_tcp_port = &local_adb_server_tcp_port;
+ if (!optarg){
+ g_printerr("ERROR: Impossible exception. Parameter required argument, but there is no it right now.");
+ return -1;
+ }
*adb_server_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
case OPT_CONFIG_LOGCAT_TEXT:
@@ -2228,6 +2232,10 @@ int main(int argc, char **argv) {
break;
case OPT_CONFIG_BT_SERVER_TCP_PORT:
bt_server_tcp_port = &local_bt_server_tcp_port;
+ if (!optarg){
+ g_printerr("ERROR: Impossible exception. Parameter required argument, but there is no it right now.");
+ return -1;
+ }
*bt_server_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
case OPT_CONFIG_BT_FORWARD_SOCKET:
@@ -2238,6 +2246,10 @@ int main(int argc, char **argv) {
break;
case OPT_CONFIG_BT_LOCAL_TCP_PORT:
bt_local_tcp_port = &local_bt_local_tcp_port;
+ if (!optarg){
+ g_printerr("ERROR: Impossible exception. Parameter required argument, but there is no it right now.");
+ return -1;
+ }
*bt_local_tcp_port = (unsigned short) strtoul(optarg, NULL, 10);
break;
default: