aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Andree <matthias.andree@gmx.de>2017-08-11 16:01:36 +0200
committerMatthias Andree <matthias.andree@gmx.de>2017-08-11 16:01:36 +0200
commita9b253b3aa0a34696d24b2d85129d8a1f613b483 (patch)
treeb8b6825364b8c5779381dd4a0e843715c230c168
parent53e6c9984e8f533f57daef7d5c3c57c2d9a7bee9 (diff)
parent010433d2c8c99e2a7895cdfa45c50f8c11b6812c (diff)
downloadfetchmail-a9b253b3aa0a34696d24b2d85129d8a1f613b483.tar.gz
fetchmail-a9b253b3aa0a34696d24b2d85129d8a1f613b483.tar.bz2
fetchmail-a9b253b3aa0a34696d24b2d85129d8a1f613b483.zip
Merge branch 'bluhm/fetchmail-plugin-length' into legacy_64
-rw-r--r--socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/socket.c b/socket.c
index 546a6bd4..f836115f 100644
--- a/socket.c
+++ b/socket.c
@@ -111,7 +111,7 @@ static char *const *parse_plugin(const char *plugin, const char *host, const cha
return NULL;
}
- while (plugin_copy_offset < plugin_copy_len)
+ while (plugin_offset < plugin_len && plugin_copy_offset < plugin_copy_len)
{ if ((plugin[plugin_offset] == '%') && (plugin[plugin_offset + 1] == 'h'))
{ strcpy(plugin_copy + plugin_copy_offset, host);
plugin_offset += 2;
@@ -130,6 +130,8 @@ static char *const *parse_plugin(const char *plugin, const char *host, const cha
}
plugin_copy[plugin_copy_len] = 0;
+ /* XXX FIXME - is this perhaps a bit too simplistic to chop down the argument strings without any respect to quoting?
+ * better write a generic function that tracks arguments instead... */
argvec = (char **)malloc(s);
if (!argvec)
{