I can only find one small error in your new patch:
If fgets can not read at least one character (because of EOF), it will return NULL. Your
definition of read_gstring_from_stdin does not handle that case (it will segfault on the
call to strlen(readp), or possibly before because the call to strip is not safe either).
I simply added a NULL check, making the definition like so:
I can only find one small error in your new patch:
If fgets can not read at least one character (because of EOF), it will return NULL. Your from_stdin does not handle that case (it will segfault on the
definition of read_gstring_
call to strlen(readp), or possibly before because the call to strip is not safe either).
I simply added a NULL check, making the definition like so:
gboolean read_gstring_ from_stdin( GString *s) string_ append( s, buffer);
{
gchar buffer[255];
char *readp;
do
{
readp = fgets(buffer, sizeof(buffer), stdin);
if (readp == NULL)
return FALSE;
strip (buffer);
g_
} while (sizeof(buffer)-1 == strlen(readp));
return TRUE;
}
and tested the resulting package with good results. I can now feed 3000 arguments to
the xauth list testcase without problems.
I'm not sure whether the return code "FALSE" actually makes sense in the above, but
as the return code isn't checked anyway... :-)