+2008-04-01 Werner Koch <wk@g10code.com>
+
+ * configure.ac (AC_INIT): Fix quoting.
+
2008-01-30 Marcus Brinkmann <marcus@g10code.de>
* configure.ac: Bump required version of automake up to 1.10.
m4_define([svn_revision], m4_esyscmd([echo -n $( (svn info 2>/dev/null \
|| echo 'Revision: 0')|sed -n '/^Revision:/ {s/[^0-9]//gp;q;}')]))
-AC_INIT([gpgme], my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision]),
+AC_INIT([gpgme],
+ [my_version[]m4_if(my_issvn,[yes],[-svn[]svn_revision])],
[bug-gpgme@gnupg.org])
+2008-04-28 Werner Koch <wk@g10code.com>
+
+ * engine-gpgconf.c (gpgconf_read): Fixed segv. Avoid memmove for
+ each line.
+
2008-04-22 Marcus Brinkmann <marcus@g10code.de>
* w32-qt-io.cpp, kdpipeiodevice.cpp: New versions from Frank
struct engine_gpgconf *gpgconf = engine;
gpgme_error_t err = 0;
#define LINELENGTH 1024
- char line[LINELENGTH] = "";
+ char linebuf[LINELENGTH] = "";
int linelen = 0;
char *argv[] = { NULL /* file_name */, arg1, arg2, 0 };
int rp[2];
do
{
- nread = _gpgme_io_read (rp[0], &line[linelen], LINELENGTH - linelen - 1);
+ nread = _gpgme_io_read (rp[0],
+ linebuf + linelen, LINELENGTH - linelen - 1);
if (nread > 0)
{
+ char *line;
+ const char *lastmark = NULL;
+ size_t nused;
+
linelen += nread;
- line[linelen] = '\0';
+ linebuf[linelen] = '\0';
- while ((mark = strchr (line, '\n')))
+ for (line=linebuf; (mark = strchr (line, '\n')); line = mark+1 )
{
- char *eol = mark;
-
- if (eol > line && eol[-1] == '\r')
- eol--;
- *eol = '\0';
+ lastmark = mark;
+ if (mark > line && mark[-1] == '\r')
+ mark--;
+ *mark = '\0';
/* Got a full line. */
err = (*cb) (hook, line);
if (err)
- break;
-
- linelen -= mark + 1 - line;
- memmove (line, mark + 1, linelen);
+ goto leave;
}
+
+ nused = lastmark? (lastmark + 1 - linebuf) : 0;
+ memmove (linebuf, linebuf + nused, nused);
+ linelen -= nused;
}
}
while (nread > 0 && linelen < LINELENGTH - 1);
if (!err && nread > 0)
err = gpg_error (GPG_ERR_LINE_TOO_LONG);
+ leave:
_gpgme_io_close (rp[0]);
return err;
AM_PATH_GPGME macro) check that this header matches the installed
library. Warning: Do not edit the next line. configure will do
that for you! */
-#define GPGME_VERSION "1.1.7-svn1301"
+#define GPGME_VERSION "1.1.7-svn1307"
\f