Matt Merhar
9df98a6e31
Avoid printing unterminated string in readline()
...
When running with -v, readline() in io.c uses strncpy() to copy a string
(*without* the terminating NULL) into an uninitialized buffer created by
malloc().
When message() then prints this, it can lead to garbage data being
emitted since it's potentially reading past the intended end of the
string. In practice, this appears to only be an additional byte or 2
before a NULL is encountered.
The issue was hit when readline() encountered "\r\n\r\n", not longer
strings, but I imagine it's dependent on things like compiler / libc /
the weather as to whether the end of the buffer returned by malloc()
will be zeroed or not; I've seen similar issues pop up with "working"
code running on newer distros.
2024-09-13 19:20:50 -04:00
Daniel Jonka
58b96facc3
fix for 100% CPU bug caused when remote server not responding
2016-02-03 17:39:35 +01:00
Daniel Jonka
5472415617
fixed buffer overflow, sizeof() is a compiletime method yet buf's size is determined during runtime
...
(taken from thieso2's fork of proxytunnel)
2016-02-03 16:32:19 +01:00
Dag Wieers
5cffce4172
Cosmetic changes and vim improvements.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@204 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-27 10:04:23 +00:00
Dag Wieers
4ab2eb5b48
Reformatted sourcecode.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@203 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-22 23:52:42 +00:00
Mark Janssen
fc32748906
Rework indentation
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@199 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-22 22:29:08 +00:00
Dag Wieers
688f352eb4
Added vim config instruction to not use spaces.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@198 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-22 17:12:21 +00:00
Dag Wieers
baaca8a6c4
More output updates
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@179 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-20 11:15:47 +00:00
Dag Wieers
24b37ca6c6
Improved verbose output, easier for the eyes
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@175 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-19 04:05:39 +00:00
Dag Wieers
579b6c509d
Fixed a bug in output.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@172 bc163920-b10d-0410-b2c5-a5491ca2ceef
2008-01-19 03:28:54 +00:00
Mark Janssen
e373e006e6
Fix typos
...
Fix malloc/buffer
Remove spurious syslog
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@159 bc163920-b10d-0410-b2c5-a5491ca2ceef
2007-07-09 11:22:18 +00:00
Mark Janssen
3c52e456fc
More fixes in SSL and string handling
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@148 bc163920-b10d-0410-b2c5-a5491ca2ceef
2007-03-05 09:08:10 +00:00
Mark Janssen
bbda7f9734
- Applied (reworked) changes from Mark Cave-Ayland to support -E option
...
encrypting data to the proxy with SSL (untested by me)
- Change version to 1.6.4
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@143 bc163920-b10d-0410-b2c5-a5491ca2ceef
2007-02-12 20:48:17 +00:00
Mark Janssen
4e5e275810
Signal Handling (dag-)
...
Reworked debug output (dag-)
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@135 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-09-01 08:32:53 +00:00
Mark Janssen
b537823b93
Clean up debug-logging, strip line-endings.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@132 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-08-31 14:28:02 +00:00
Mark Janssen
7f7f772444
Fosdem changes
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@120 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-26 09:13:40 +00:00
Mark Janssen
860e177e53
Cleanup setproctitle, changed return-type of readline()
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@111 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-11 00:21:16 +00:00
Mark Janssen
f38d506949
Fix compile issue when not defining USE_SSL
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@101 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-08 08:36:24 +00:00
Mark Janssen
bf693b0afc
Very cool... we now do SSL encryption in the connection. This will fool
...
protocol-inspecting proxies (requires stunnel or other ssl wrapper on the server side)
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@94 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-06 14:40:42 +00:00
Mark Janssen
cd31841d7b
Update copyright headers (2006)
...
Remove permission setting in makefile-install part, to make packagebuilders happy
Added link for more info on -r option to README
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@93 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-06 13:05:30 +00:00
Mark Janssen
142cd3e4eb
- Replaced -g/-G (proxy host and port) with -p proxy:post shorthand
...
- Replaced -d/-D (dest host and port) with -d host:post shorthand
- Added proxy-bouncing support, courtesy of Dag Wieers, authentication
only works on the FIRST proxy, not on a second proxy !!
- Dropped -n option (dottedquad)
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@88 bc163920-b10d-0410-b2c5-a5491ca2ceef
2006-02-06 10:58:26 +00:00
Mark Janssen
1518b7e0ca
Now cleanly compiles on FreeBSD.
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@27 bc163920-b10d-0410-b2c5-a5491ca2ceef
2002-04-20 17:22:06 +00:00
Mark Janssen
6f626da741
Cleaning up more... moving more stuff to separate .c and .h files
...
git-svn-id: https://proxytunnel.svn.sourceforge.net/svnroot/proxytunnel/trunk/proxytunnel@20 bc163920-b10d-0410-b2c5-a5491ca2ceef
2002-04-20 15:54:43 +00:00