398 Commits

Author SHA1 Message Date
Riccardo Schirone
2d160f2509
Avoid sdb double headers (#17249) ##build
* Avoid duplication of SDB headers in libr/include

SDB is an external project and as such it should live in shlr. However,
for simplicity in dealing with the include flags, the SDB headers were
copied in libr/include as well. This patch just keeps the SDB files
confined in shlr/sdb and make sure various r_* libs use the headers from
there.

* Fix pkgconfig file generation
2020-07-21 10:28:43 +02:00
Riccardo Schirone
594b940b7c
Fixes some of the issues in Travis (#17267)
* Do not check with r_return_ if the convention is present

Let's just assume the NULL default in such a case, so that architectures
for which we don't have a defined calling convention can still be
processed somehow by the analysis code. It won't be precise, but it's
better than nothing.

Also add a warning message so users are aware when the calling
convention is not defined.

* Fix oob-read when # is at the end of the cmd string

* Do not set TMPDIR when the new value is the empty string

When TMPDIR is set to empty value, clang+ld behaves in weird ways and
you cannot compile files from within the r2 shell (e.g. when using #!c
or #!cpipe)

* Use meson and add -lasan to pkgconfig files when sanitizer are used
2020-07-16 20:47:30 +08:00
David CARLIER
5c71b01097
Support self:// for Solaris (#17196) ##io
enabled only on 64 bits unsupported on 32 bits with large files.
missing cfmakeraw function on this platform for socket et cons.
2020-07-03 18:59:24 +02:00
pancake
d47aed440a
Fix covs from 2020-06-29 (#17184)
* Fix covs from 2020-06-29

* CIDs: 1293553 1408695 1430058 1430059 1430060
1430061 1430062 1430063 1430064 1430065 1430067

* More fixes

Co-authored-by: pancake <pancake@nopcode.org>
2020-07-01 09:33:38 +08:00
pancake
160fc95e66
Use (void) instead of () in function signatures (#17026) ##refactoring
* Use (void) instead of () in function signatures
* Add test to avoid further contributions to commit the same mistake
2020-06-14 16:08:32 +02:00
pancake
84ecf9fff2
Fix all the coverities detected last month (#17060)
* Fix all the coverities detected last month

* Fix one more cov

* Fix build

* refix build

Co-authored-by: pancake <pancake@nopcode.org>
2020-06-14 13:21:57 +02:00
Anton Kochkov
ffe743ef39
Fix #4056 - rename DEPS to R2DEPS ##build (#17020)
* Rename DEPS to R2DEPS
* Cleanup of sys/build.sh
2020-06-12 10:49:28 +08:00
GustavoLCR
04edfa82c1
Fix command injection on PDB download (#16966)
* Fix r_sys_mkdirp with absolute path on Windows
* Fix build with --with-openssl
* Use RBuffer in r_socket_http_answer()
* r_socket_http_answer: Fix read for big responses
* Implement r_str_escape_sh()
* Cleanup r_socket_connect() on Windows
* Fix socket being created without a protocol
* Fix socket connect with SSL ##socket
* Use select() in r_socket_ready()
* Fix read failing if received only protocol answer
* Fix double-free
* r_socket_http_get: Fail if req. SSL with no support
* Follow redirects in r_socket_http_answer()
* Fix r_socket_http_get result length with R2_CURL=1
* Also follow redirects
* Avoid using curl for downloading PDBs
* Use r_socket_http_get() on UNIXs
* Use WinINet API on Windows for r_socket_http_get()
* Fix command injection
* Fix r_sys_cmd_str_full output for binary data
* Validate GUID on PDB download
* Pass depth to socket_http_get_recursive()
* Remove 'r_' and '__' from static function names
* Fix is_valid_guid
* Fix for comments
2020-06-10 18:00:00 +02:00
Yusef Karim
6a0d90d2f5
Create writefds set to fix socket timeout in r_socket_connect (fixes #16788) (#16946)
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
2020-05-25 14:24:06 +08:00
Disconnect3d
179345644d
Fix string length in strncmp call of the http server (#16569) 2020-04-24 11:30:40 +02:00
pancake
e9d49c92f5 Fix build without forkpty (windows) 2020-04-20 17:04:30 +02:00
pancake
498292a70d Fix the static build by dynamically resolving libutil symbols ##build 2020-04-20 14:25:28 +02:00
pancake
315050e7ab Fix last coverities 2020-04-13 23:57:16 +02:00
Alexis Ehret
ef07476e38
Fix various lgtm warning (#16497)
* Wrong type of arguments to formatting function root/shlr/mpc/mpc.c
* Overflow in uncontrolled allocation size ./libr/socket/run.c
* Multiplication result converted to larger type ./libr/core/cmd_print.c
* Multiplication result converted to larger type ./libr/bin/p/bin_dyldcache.c
* Multiplication result converted to larger type ./libr/core/linux_heap_glibc.c
* Multiplication result converted to larger type ./libr/core/visual.c
* Comparison of narrow type with wide type in loop condition ./libr/core/p/core_java.c
* Fix various warning -Wall ./libr/core/p/core_java.c
* Multiplication result converted to larger type ./libr/bin/format/mach0/mach0.c
* Multiplication result converted to larger type ./libr/util/print.c
* Multiplication result converted to larger type ./libr/asm/asm.c
* Fix small warning python
* Fix type error and declaration inside loop
* Reset mpc
* replace size_t
* Fix space missing, type and format
2020-04-12 20:45:24 +02:00
pancake
54617455de
Initial refactoring of the rap:// protocol (-75 LOC) ##socket (#16534)
* It's implemented in IO, Socket and Core
* Remove duplicated apis and defines, everything in in RSocket now
* RIO now owns an RCoreBind instead of 3 fcn pointers + 1 void*
* Use proper filenames in libr/socket following public api names
* Use RSocket.block apis in the rap client + server apis
2020-04-12 16:40:55 +02:00
radare
5e4cdaaa04
Always use r_getopt, do not depend on libc (not just on windows) ##core (#16325) 2020-03-27 17:06:40 +01:00
yossizap
778c42cfa7
Fix socket connection issue (#16218) ##socket
PR #16073 exposed that the linux implementation of r_socket_is_connected
returned -1 from recv with errno set to EAGAIN. This broke gdbr and
probably other remote capabilities since r_socket_connect would fail.
I switched the implementation to getsockopt which is more reliable
instaed of playing with non blocking settings.
2020-03-15 11:56:55 +01:00
radare
5e629a3260
Avoidify the strTrim() APIs + cleanup/refactor ##util (#16056) 2020-03-02 21:39:37 +01:00
Paul I
0e62dda341
Fix fgets() usage (#16068) 2020-02-29 20:47:10 +01:00
radare
6ae8806411
Do not use the elvis operator for bool expressions (#16073) 2020-02-28 15:19:37 +01:00
Anton Kochkov
9ae41ae69f
Revert "Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor" (#16055)
This reverts commit 38b61c7bcfe55a727b9c3cedbc0f3147018e7c6b.
2020-02-26 09:59:04 +08:00
radare
38b61c7bcf
Avoidify the RUtil.strTrim() APIs, rename trimHeadTail() and add asserts in RConfig ##refactor 2020-02-25 17:53:09 +01:00
Anton Kochkov
d5d5cd3bfa
Some coverity fixes (#15643) 2019-12-16 04:36:46 -06:00
yossizap
ebfbf1a039 Fix r_socket_connect not using the given timeout in unix ##network
Connect isn't effected by r_socket_block_time since it can only change the
timeout of read(and not implemented, write) actions with setsockopt.
Also, connect may wait for an unspecified amount of time so we have to use
select.
2019-11-18 01:38:08 +01:00
dok
34e4bd7291 Use sigaction instead of signal ##core 2019-11-06 12:41:36 +01:00
Anton Kochkov
5aa127fe22 Fix build 2019-10-09 16:58:42 +08:00
pancake
6b6ea317f9 Handle free for R2pipe.open_dl() 2019-10-09 10:16:16 +02:00
pancake
596cbf2903 Implement r2pipe_open_dl() to use dlopen/dlsym ##r2pie 2019-10-09 00:42:24 +02:00
Paul I
64a6baf0a9 Use abs path for LIBDIR and INCLUDEDIR on Windows (#15096) 2019-09-22 10:42:49 +02:00
Paul I
016c1f73cb Add R_INVALID_SOCKET macro (#15094) 2019-09-22 00:32:35 +02:00
radare
e1cf65332a
Use r_sandbox_fopen instead of fopen (#14832) 2019-08-18 17:19:53 +02:00
radare
d8362da581
Fix timeout issue in http.get ##io 2019-07-23 18:32:48 +02:00
pancake
2f9acaeead Minor function signature fixes 2019-07-15 16:22:20 +02:00
Anton Kochkov
20e19d6023 More spelling fixes in the code 2019-06-20 13:36:02 +08:00
pancake
6eed2bbafb Handle R2_CURL env var in RSocket.httpGet ##network 2019-06-08 11:38:55 +02:00
pancake
3b2aceaaac Add usec precission for RSocket.blocTime() and improve r2web:// a bit 2019-05-31 15:24:51 +02:00
pancake
99502ef5bb Fix r2web block times 2019-05-31 04:52:23 +02:00
pancake
5b753d3324 Speedup r2web:// ##remote 2019-05-31 04:46:36 +02:00
pancake
073fcca0f3 Make -C http work like the tcp and rap remotes, expose the shell via == ##remote 2019-05-17 12:09:23 +02:00
pancake
10109fec62 Fix issues with the tcp server .: and =+tcp, use index instead of fd ##remote 2019-05-17 01:04:31 +02:00
radare
51cc15072a
Fix some UAF in rap server, handle HTTP over rap and tcp properly ##remote (#14081) 2019-05-16 14:18:16 +02:00
radare
967b9e3a82
Fix some LGTM warnings (#14047) 2019-05-13 14:09:33 +02:00
Anton Kochkov
b858e7e10e Fix #13430 - Kill MinGW remnants ##deprecate 2019-03-31 12:03:07 +02:00
radare
e04f31a313
Completely kill the msvc/ directory and the unix-specific includes workarounds 2019-03-19 17:34:02 +01:00
pancake
c80dbc6e9a Fix http webserver regression introduced in 81ad0fe809a45e428abdcb37db7bf83ef09ad26e 2019-03-15 19:42:13 +01:00
Anton Kochkov
bb67b54f74
Remove CYGWIN & MINGW remnants (#13377) 2019-03-15 12:55:08 +08:00
GustavoLCR
81ad0fe809 Fix #13234 - Allow reopening of webserver ##sync
* Fix hang after ctrl-c
2019-03-06 04:43:32 +01:00
David CARLIER
10548ca4db Fix compilation on Android ##build 2019-03-03 14:10:44 +01:00
David CARLIER
38c8ebea72 ASLR settings little refactor, available as util mean ##debug 2019-02-21 23:03:20 +01:00
David CARLIER
2cda3e06d8 FreeBSD will be having aslr finally ##debug 2019-02-21 02:29:31 +01:00