aboutsummaryrefslogtreecommitdiffstats
path: root/extcap/androiddump.c
AgeCommit message (Collapse)AuthorFilesLines
2016-12-30androiddump: add missing sys/time.h headerBaruch Siach1-0/+4
struct timeval requires sys/time.h. Fixes the following musl libc build error: androiddump.c: In function 'useSndTimeout': androiddump.c:262:18: error: variable 'socket_timeout' has initializer but incomplete type const struct timeval socket_timeout = { ^ Change-Id: I52e204f32a012aabea2e54877e564576c072fe08 Reviewed-on: https://code.wireshark.org/review/19460 Reviewed-by: Michal Labedzki <michal.tomasz.labedzki@gmail.com> Petri-Dish: Michal Labedzki <michal.tomasz.labedzki@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-12-20extcap: set help page for all extcaps.Dario Lombardo1-1/+2
They've been set to the manpage of the local filesystem. Ping-Bug: 13218 Change-Id: Iacd5d2ba7ae39ee1718b59747c245d1c07785e8f Reviewed-on: https://code.wireshark.org/review/19179 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-12-05androiddump: Add support for Bluetooth on Android 7.0Michal Labedzki1-2/+9
Now "ps" command does not support process name as parameter, use grep instead. Change-Id: I0c35bc7d560e237e4140000e67af097744cb2c1b Reviewed-on: https://code.wireshark.org/review/19087 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-12-04Have a routine to do all the work of initializing libwiretap.Guy Harris1-2/+1
Have programs that use libwiretap call that routine rather than separately calling some or all of init_open_routines(), wtap_register_plugin_types(), and wtap_opttypes_initialize(). Also don't have routines internal to libwiretap call those. Yes, this means doing some initialization work when it isn't necessary, but scattering on-demand calls throughout the code is a great way to forget to make those calls. Change-Id: I5828e1c5591c9d94fbb3eb0a0e54591e8fc61710 Reviewed-on: https://code.wireshark.org/review/19069 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-11-18androiddump: check return value in useSndTimeout() (CID 1394378).Dario Lombardo1-2/+5
Change-Id: I14109ffe1b9930c464ce2c42767f96b8ba4e5b67 Reviewed-on: https://code.wireshark.org/review/18855 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-11-10androiddump: Set socket connect() timeout to 500msMichal Labedzki1-1/+24
This should avoid neverending or long time to obtain timeout in some cases like firewall's drop rules, etc. Bump version to 1.0.4 Bug: 13104 Ping-Bug: 13114 Change-Id: I9bef714b6d92b3516a2a95ebdbe1ba594fa60e34 Reviewed-on: https://code.wireshark.org/review/18728 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-10-19androiddump: Fix help - interfacesMichal Labedzki1-14/+21
Fix help output that describes interfaces provided by tool to reflect reality - add missed DEVICE_ID that is part of interface. Change-Id: Ib6374db28d8d4696ce27c5358da49d3ebfcf31e1 Reviewed-on: https://code.wireshark.org/review/18267 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Tested-by: Michael Mann <mmann78@netscape.net>
2016-10-19extcap: put missed parameters into the helpMichal Labedzki1-2/+0
"--debug" and "--extcap-version" are part of extcap-base helper, do not hide them. Change-Id: I287b68dbed5344c188fede69d112ab007a6ee18b Reviewed-on: https://code.wireshark.org/review/18279 Reviewed-by: Dario Lombardo <lomato@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-09-16Type and size cleanups.Guy Harris1-8/+39
Use size_t for sizes. Do checks to make sure we don't overflow ints. Change-Id: Id0846cc5c6348d67a23064517ad1c432cf1cb61a Reviewed-on: https://code.wireshark.org/review/17742 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-16Add ws_hexstrtou{bits} and use ws_hexstrtou32 in androiddump.Guy Harris1-2/+6
Make the reply length unsigned - there's no reason for it to be signed. Change-Id: I5f4d1f027eeddee939547c052220efb89800f4b1 Reviewed-on: https://code.wireshark.org/review/17740 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-16extcap: make extcap use the ws_strtoi/u functions.Dario Lombardo1-4/+14
Change-Id: Id75c72eba869c8a0f413ce8b5d6329ce172aed1f Reviewed-on: https://code.wireshark.org/review/17415 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-09-12androiddump: fix memleaksPeter Wu1-23/+35
Most of the actions (e.g. `androiddump --extcap-interfaces`) return immediately without cleaning up. Fix this by adding a common exit path. Change-Id: If02b18da49d866fb5525306e52fbf4590d98ecd2 Reviewed-on: https://code.wireshark.org/review/17634 Petri-Dish: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-08-26extcap: improve interface print in help.Dario Lombardo1-1/+15
Change-Id: Ife8e73b6cb1756623e937452fc042d8b31e2554f Reviewed-on: https://code.wireshark.org/review/17321 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-08-25extcap: add binary name and version to help message.Dario Lombardo1-1/+2
Change-Id: I8f8083c817065cf66fd006a1caeb309d26209509 Reviewed-on: https://code.wireshark.org/review/17305 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Peter Wu <peter@lekensteyn.nl> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-24extcap: make extcaps use the version registered in config.Dario Lombardo1-1/+1
Change-Id: I12d0d0bec06e02af0a9d0877c0f0f1d86261d752 Reviewed-on: https://code.wireshark.org/review/17296 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-11androiddump: use socklen_t (32bit) instead of gssize (64bit) (CID 1293384).Dario Lombardo1-3/+4
Change-Id: Ia5b7bc190eb8af509a880bb23bc0879a2dcfd39c Reviewed-on: https://code.wireshark.org/review/16972 Reviewed-by: João Valverde <j@v6e.pt> Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-08-09androiddump: fix bug in socket retry (CID 1293391).Dario Lombardo1-4/+4
Change-Id: I61914d208e984d202506cdc885493e841e929990 Reviewed-on: https://code.wireshark.org/review/16948 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: Michal Labedzki <michal.labedzki@tieto.com>
2016-08-04extcap: restyle the help function.Dario Lombardo1-26/+27
Change-Id: Ia742dffb1fd4cd5780b8ba44f7064d1874e473da Reviewed-on: https://code.wireshark.org/review/16842 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-08-04extcap: restyle the output subsystem.Dario Lombardo1-208/+178
Change-Id: I3e0674751eb97bf30ae6d70c4e51f347d63b1697 Reviewed-on: https://code.wireshark.org/review/16849 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-07-16androiddump.c - Address VS Code Analysis warnings.Michael Mann1-3/+3
1. Take large "packet" byte arrays off of stack and onto heap. 2. Cast away an shift operation that should have been identified as safe anyway. Change-Id: I159c4a7452744763f667336cf4824d5ac3472343 Reviewed-on: https://code.wireshark.org/review/16500 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-16Have extcap executables mirror the GTK's WinMain signature.Michael Mann1-2/+6
This is for appeasing VS Code Analysis. Change-Id: Ib7b3d8a3025dd764da283335051d0f77b45f6dee Reviewed-on: https://code.wireshark.org/review/16499 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-07-14androiddump.c: Use preprocessor directive to distinguish E_AGAIN and ↵Michael Mann1-9/+60
E_WOULDBLOCK. VS Code analysis considers them hardcoded values so the if statement is either always true or always false. Change-Id: Iad04add9391c515873e2e00d2c6cbd682fbf5b3f Reviewed-on: https://code.wireshark.org/review/16419 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-04androiddump: fix leak (CID 1293387).Dario Lombardo1-0/+1
Change-Id: I27e167368575dfddf78c237723d20c8b790e5f15 Reviewed-on: https://code.wireshark.org/review/16268 Petri-Dish: Dario Lombardo <lomato@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-15androiddump: fix leak on --extcap-interfacesPeter Wu1-0/+2
extcap_base_register_interface duplicates the memory, so there is no need to keep it around. Change-Id: I2bac8be519b659504c512d4eb29be8f7ef6dbd59 Reviewed-on: https://code.wireshark.org/review/15919 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-05-18androiddump: Add model name to user-friendly interface nameMichal Labedzki1-21/+40
This can speed up searching for interface specified to model of Android device - in most cases it is its market name. Change-Id: Ib5a3b96d9a2a8cf325f62614d395508b4ec58199 Reviewed-on: https://code.wireshark.org/review/15454 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-19androiddump 1.0.3: Return more specific error codesMichal Labedzki1-149/+199
There is 68 generic error exit codes + 45 specific error codes. Total: 113 error codes, so it is possible to have all specific exit codes in future - max is 254 (UNIX limitation). Change-Id: I798bf77b03031a701e90272d01e90b04e7e31940 Reviewed-on: https://code.wireshark.org/review/14763 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-06androiddump: Change insecure sprint into g_snprintfMichal Labedzki1-20/+140
This avoid potential overflows. Bug: 12093 Change-Id: Icbfe4a9f04c5f8d4e0284e4800d4775773246abf Reviewed-on: https://code.wireshark.org/review/14762 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-04-04androiddump: Fix crash on start capturingMichal Labedzki1-0/+6
Wiretap require registration right now. Do it. Change-Id: I7ec4c4a4c6d3fa6625fff970f7f39f1ab74e3ef5 Reviewed-on: https://code.wireshark.org/review/14761 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-02androiddump: Register interfaces when list interfacesMichal Labedzki1-3/+3
Trying to find interfaces every androiddump run use a lot of system resources so Wireshark can hang for a while. Back to old behaviour and register interfaces only when list them. Change-Id: Ib63cad05fb47722d3b9de24abf28a86e614417cd Reviewed-on: https://code.wireshark.org/review/14764 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-12androiddump 1.0.2: Fix a lot of usage of recv()Michal Labedzki1-73/+171
recv() can return negative value or 0 in "error cases". There is need to check it. This also solved empty interfaces list if there is unauthenticated device. Bug: 12080 Change-Id: If6cd0e0933b64e9ac9bbb66b3b8138f7177451d1 Reviewed-on: https://code.wireshark.org/review/14316 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-03-04androiddump: change first error message into verbose_print()Dario Lombardo1-1/+1
This error occurs every run of wireshark if adb is not running. This is a bit noisy, so androiddump is made less verbose. Bug: 12185 Change-Id: Ia7d0b0aba95e90a7f602c2e340f6344d09205b32 Reviewed-on: https://code.wireshark.org/review/14288 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com>
2016-02-29extcap: Move extcap handling to baseRoland Knall1-120/+81
Also add the extcap-version parameter to enable parsing of version and helppage separately Change-Id: I35ba5aa992940ffbb0cd9ebea8b7c3a1e8629d74 Reviewed-on: https://code.wireshark.org/review/14094 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-26extcap: move windows functions into extcap-baseDario Lombardo1-46/+0
Change-Id: Iec7fed027a24992afd673b09c32470af51739ae5 Reviewed-on: https://code.wireshark.org/review/14075 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-25extcap: move includes into extcap-base.Dario Lombardo1-32/+0
Change-Id: I802cc3a3bb3989411216ed070ecc018345e0d54f Reviewed-on: https://code.wireshark.org/review/14073 Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-25extcap: move common code into extcap-base filesDario Lombardo1-255/+140
Change-Id: Ia4a73c7df39426c8773fce04cac223bda3c6ef1c Reviewed-on: https://code.wireshark.org/review/14071 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Dario Lombardo <lomato@gmail.com> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-13androiddump: fix logical ‘or’ of equal expressions [-Werror=logical-op] ↵Alexis La Goutte1-9/+9
found by gcc6 EAGAIN and EWOULDBLOCK is the same value (now) http://www-numi.fnal.gov/offline_software/srt_public_context/WebDocs/Errors/unix_system_errors.html Change-Id: Ia8101d05194910f306e8439507ae5bde3ccd00ce Reviewed-on: https://code.wireshark.org/review/13905 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-02-05Fix some Coverity issueMichal Labedzki1-0/+4
>>> CID 1349726: Incorrect expression (COPY_PASTE_ERROR) >>> "tvb_reported_length_remaining" in "tvb_reported_length_remaining(tvb, offset)" looks like a copy-paste error. >>> CID 1349727: Incorrect expression (COPY_PASTE_ERROR) >>> "tree" in "dissector_try_uint_new(bluetooth_eir_ad_manufacturer_company_id, company_id, new_tvb, pinfo, >>> CID 1349728: (DEADCODE) >>> Execution cannot reach this expression "0" inside statement "(0 && ((__s1_len = __builti...". >>> CID 1306904: Logically dead code (DEADCODE) >>> Execution cannot reach this statement "tap_hci_summary->interface_...". Change-Id: I5f99e37e6d5fac39da7082649caa8373d06bb808 Reviewed-on: https://code.wireshark.org/review/13739 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-01androiddump: fix printf format warning.Dario Lombardo1-3/+6
Found by clang. Compiler warning: warning: format specifies type 'void *' but the argument has type 'char *' [-Wformat-pedantic] Change-Id: I7f370b06f98490cd6e363a9679a449420c8c8021 Reviewed-on: https://code.wireshark.org/review/13602 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2016-01-18androiddump: There is no need to make full copy optargMichal Labedzki1-4/+4
Copy pointer is enough. Change-Id: I51188a8434f6e4ba1d9bf3456bd29e027dd40f35 Reviewed-on: https://code.wireshark.org/review/13393 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-15androiddump: Return extcap version informationRoland Knall1-1/+7
Change-Id: I22cdf02286262ae55ea94b4387791d3d28769f31 Reviewed-on: https://code.wireshark.org/review/13286 Petri-Dish: Roland Knall <rknall@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Roland Knall <rknall@gmail.com>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-2/+2
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-17anddroiddump: fix compilation errors with Win64 and OSX 10.5 x86Pascal Quantin1-2/+2
Change-Id: Ie8aa666cd0b10b4260bf184ff35734589c71a8aa Reviewed-on: https://code.wireshark.org/review/12705 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-12-17Try to fix some PVS Studio warningsMichal Labedzki1-43/+70
V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 626 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 661 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 678 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 689 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 700 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 711 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 728 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 739 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 750 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 761 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 810 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 867 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 889 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 949 V814 Decreased performance. The 'strlen' function was called multiple times inside the body of a loop. androiddump.c 971 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 1876 V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 1950 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2053 V804 Decreased performance. The 'strlen' function is called twice in the specified expression to calculate length of the same string. androiddump.c 2056 V512 A call of the 'memcpy' function will lead to underflow of the buffer 'packet + exported_pdu_headers_size'. androiddump.c 2122 V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2207 V590 Consider inspecting this expression. The expression is excessive or contains a misprint. androiddump.c 2227 V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2275 V530 The return value of function 'freopen' is required to be utilized. androiddump.c 2279 V808 'name' object of 'QString' type was created but was not utilized. bluetooth_devices_dialog.cpp 201 V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_devices_dialog.cpp 337 V807 Decreased performance. Consider creating a pointer to avoid using the 'item->child(i_item)' expression repeatedly. bluetooth_hci_summary_dialog.cpp 648 V807 Decreased performance. Consider creating a pointer to avoid using the 'ui->tableTreeWidget->headerItem()' expression repeatedly. bluetooth_hci_summary_dialog.cpp 669 Change-Id: Ia81b5f867b2b1e0ee58eed0bd297800774bc37f9 Reviewed-on: https://code.wireshark.org/review/12683 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-12-17androiddump: Remove all mallocsMichal Labedzki1-184/+29
Removing all malloc improve reliability, simplify code, reduces memory usage... Bug: 11608 Change-Id: Ie56312a1afdf298e926bb242825565b52dbd85d3 Reviewed-on: https://code.wireshark.org/review/12682 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-12-17androiddump: Some Coverity fixesMichal Labedzki1-8/+22
CID 1295677: (CHECKED_RETURN) CID 1293385: (NEGATIVE_RETURNS) Change-Id: I142f1f9629af9339261b74e54a1a40b595ddecb5 Reviewed-on: https://code.wireshark.org/review/12681 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-12-08androiddump: fix crash on Windows when running in verbose modePascal Quantin1-133/+133
As explained in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6695#c2 g_frpintf unfortunately crashed on Windows. Let's go back to fprintf instead. It will create warnings with MSVC2015 but we do not use it officially yet and at least androiddump will be working correctly again. Change-Id: Idfdb608576e18af63650af80e01bcda36dd81ac4 Reviewed-on: https://code.wireshark.org/review/12435 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-20androiddump: Add Bluetooth support for Android MMichal Labedzki1-3/+5
In real it is a fix, because the only change is new name of process of the same application on Android. Change-Id: I69d1362e9f11967ec1127ff89c7b45299d291fe8 Reviewed-on: https://code.wireshark.org/review/11984 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-11-09androiddump: make nanoseconds intStig Bjørlykke1-1/+1
This fixes a compiler warning on OS X: extcap/androiddump.c:312:42: warning: implicit conversion loses integer precision: 'long' to '__darwin_suseconds_t' (aka 'int') [-Wshorten-64-to-32] pcap_header.ts.tv_usec = nanoseconds / 1000; ~ ~~~~~~~~~~~~^~~~~~ Change-Id: I6077130fbe4e1cb4f26d82271cfb85d1bf03e35c Reviewed-on: https://code.wireshark.org/review/11655 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-11-05extcap: Provide capture filter to extcap binaryStig Bjørlykke1-0/+5
Added the option --extcap-capture-filter to extcap to send the capture filter from the main screen to the extcap binary. Change-Id: I75f0d7dbec810551225377f9221053298488cdd5 Reviewed-on: https://code.wireshark.org/review/11423 Reviewed-by: Roland Knall <rknall@gmail.com> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-09-23androiddump: add memset in adb_connect() (CID 1293396)Dario Lombardo1-0/+2
Change-Id: If9d281cd95cf12351d6da5e75c6de149ec7adc06 Reviewed-on: https://code.wireshark.org/review/10598 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>