From 877bbb205c95b273ea0d68f184cdda15acc08875 Mon Sep 17 00:00:00 2001 From: Sunzen Wang Date: Mon, 18 May 2009 20:38:02 +0800 Subject: Fix: Enhance -p option checking so as to just accept valid number --- main.cxx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 1ac5dd5a..39d835d7 100644 --- a/main.cxx +++ b/main.cxx @@ -469,6 +469,7 @@ main (int argc, char * const argv []) while (true) { int long_opt; + char * num_endptr; #define LONG_OPT_KELF 1 #define LONG_OPT_KMAP 2 #define LONG_OPT_IGNORE_VMLINUX 3 @@ -518,8 +519,8 @@ main (int argc, char * const argv []) cerr << "Listing (-l) mode implies pass 2." << endl; usage (s, 1); } - s.last_pass = atoi (optarg); - if (s.last_pass < 1 || s.last_pass > 5) + s.last_pass = (int)strtoul(optarg, &num_endptr, 10); + if (*num_endptr != '\0' || s.last_pass < 1 || s.last_pass > 5) { cerr << "Invalid pass number (should be 1-5)." << endl; usage (s, 1); -- cgit From 5d8d4509dd8112b4cf2b6aada1dca9e72bac2f44 Mon Sep 17 00:00:00 2001 From: Sunzen Wang Date: Tue, 19 May 2009 09:07:11 +0800 Subject: Enhance -s option checking to only accept valid size number Fix: Enhance -s option checking to only accept valid size number --- main.cxx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 39d835d7..ec5506f5 100644 --- a/main.cxx +++ b/main.cxx @@ -626,8 +626,8 @@ main (int argc, char * const argv []) break; case 's': - s.buffer_size = atoi (optarg); - if (s.buffer_size < 1 || s.buffer_size > 4095) + s.buffer_size = (int) strtoul (optarg, &num_endptr, 10); + if (*num_endptr != '\0' || s.buffer_size < 1 || s.buffer_size > 4095) { cerr << "Invalid buffer size (should be 1-4095)." << endl; usage (s, 1); -- cgit From c897e941ca645ab1e2aa325e5feaae30cc43060e Mon Sep 17 00:00:00 2001 From: Sunzen Wang Date: Tue, 19 May 2009 09:11:01 +0800 Subject: Enhance -x option checking to only accept valid pid Fix: Enhance -x option checking to only accept valid pid --- main.cxx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index ec5506f5..1f4f9812 100644 --- a/main.cxx +++ b/main.cxx @@ -639,7 +639,12 @@ main (int argc, char * const argv []) break; case 'x': - s.target_pid = atoi(optarg); + s.target_pid = (int) strtoul(optarg, &num_endptr, 10); + if (*num_endptr != '\0') + { + cerr << "Invalid target process ID number." << endl; + usage (s, 1); + } break; case 'D': -- cgit From 2ed04863c3426f94932d4a4e4b5d6c7b84e49dfd Mon Sep 17 00:00:00 2001 From: William Cohen Date: Wed, 27 May 2009 11:14:12 -0400 Subject: Suggest rpms to install using debuginfo-install. The patch makes use of the RPM libraries to determine which rpm supplied the executable and from that information suggest a command to install the appropriate debuginfo rpm. This is enabled using the "--with-rpm" option for configure. Can be explicitly disabled with "--without-rpm". --- main.cxx | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'main.cxx') diff --git a/main.cxx b/main.cxx index 1f4f9812..9dc658ff 100644 --- a/main.cxx +++ b/main.cxx @@ -20,6 +20,7 @@ #include "util.h" #include "coveragedb.h" #include "git_version.h" +#include "rpm_finder.h" #include #include @@ -1069,6 +1070,9 @@ main (int argc, char * const argv []) } } + /* Print out list of missing files */ + missing_rpm_list_print(s); + if (rc || s.listing_mode || s.last_pass == 2 || pending_interrupts) goto cleanup; // PASS 3: TRANSLATION -- cgit