Page MenuHome GnuPG

Infinite loop while reading option file
Closed, ResolvedPublic

Description

Release: 0.6.1

Environment

Compiled from sources on Gentoo Linux PPC installed on iMac, with CFLAGS="-O3 -pipe -mcpu=750"

Description

First use of gpa seems to run ok, but it doesn't start the second time. According to strace, the program does not seem to be able to detect the end ~/.gnupg/gpa.conf. Using gdb I found the function read_next_word in options.c was never returning because (c = getc (file)) can't be EOF since c is a char (at least on my system)...

Fix

Here is a patch which solved my problem :

    • gpa-0.6.1/src/options.c 2003-01-15 01:16:23.000000000 +0100 +++ gpa-0.6.1.new/src/options.c 2003-09-17 18:54:39.000000000 +0200 @@ -342,7 +342,7 @@ read_next_word (FILE *file, char *buffer, int size) { int i = 0;
  • char c; + int c;

    buffer[0] = '\0'; /* Skip leading whitespace */ @@ -358,7 +358,7 @@ /* Read the word */ while ((c = getc (file)) != EOF && !isspace (c) && i < (size-1)) {
  • buffer[i++] = c; + buffer[i++] = (char) c; } buffer[i] = '\0';

Event Timeline

Fixed in CVS since 2003-02-10. Thanks for reporting anyway.