diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-30 20:22:18 +0100 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-01-30 20:22:18 +0100 |
commit | 4bf36b4cfa9d830f40e1b5610df99018e9bb73cc (patch) | |
tree | dcfd5eb735b8ea547142be68f993a3f555ecb0b0 /methods/gpgv.cc | |
parent | d0254ba7ea3f3de175d11cdc877cc4350692ba4a (diff) | |
parent | b9ed63d39e8771f42ec74e3ad401b7c1e846b206 (diff) |
merged from donkult
Diffstat (limited to 'methods/gpgv.cc')
-rw-r--r-- | methods/gpgv.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/methods/gpgv.cc b/methods/gpgv.cc index 2b2aba017..25ba0d063 100644 --- a/methods/gpgv.cc +++ b/methods/gpgv.cc @@ -98,8 +98,16 @@ string GPGVMethod::VerifyGetSigners(const char *file, const char *outfile, // Read a line. Sigh. while ((c = getc(pipein)) != EOF && c != '\n') { - if (bufferoff == buffersize) - buffer = (char *) realloc(buffer, buffersize *= 2); + if (bufferoff == buffersize) + { + char* newBuffer = (char *) realloc(buffer, buffersize *= 2); + if (newBuffer == NULL) + { + free(buffer); + return "Couldn't allocate a buffer big enough for reading"; + } + buffer = newBuffer; + } *(buffer+bufferoff) = c; bufferoff++; } |