diff options
author | Reuben Thomas <rrt@sc3d.org> | 2013-12-16 12:27:50 +0000 |
---|---|---|
committer | Reuben Thomas <rrt@sc3d.org> | 2013-12-16 12:27:50 +0000 |
commit | cff1bdca014abf286ae449524eab876c3313d39a (patch) | |
tree | b1c11d1698eb5308a525a7bcd2e9a115eb09428c | |
parent | bdc4e6f675930e28bfcb373225ef8cb4a9e47340 (diff) | |
download | plptools-cff1bdca014abf286ae449524eab876c3313d39a.tar.gz plptools-cff1bdca014abf286ae449524eab876c3313d39a.tar.bz2 plptools-cff1bdca014abf286ae449524eab876c3313d39a.zip |
Fix a potential overrun in options parsing (thanks, Mayhem); fixes Debian bug #716591
-rw-r--r-- | plpfuse/main.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/plpfuse/main.cc b/plpfuse/main.cc index 5ff2f78..07564a0 100644 --- a/plpfuse/main.cc +++ b/plpfuse/main.cc @@ -440,11 +440,13 @@ int main(int argc, char**argv) { break; case 'p': parse_destination(optarg, &host, &sockNum); - for (i = oldoptind; i < argc - (optind - oldoptind); i++) - argv[i] = argv[i + (optind - oldoptind)]; argc -= optind - oldoptind; + for (i = oldoptind; i < argc; i++) + argv[i] = argv[i + (optind - oldoptind)]; break; } + if (optind >= argc) + break; } skt = new ppsocket(); |