[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: 1.10 API review - svn_io_stdin_readline()

From: Nathan Hartman <hartman.nathan_at_gmail.com>
Date: Mon, 15 Jan 2018 21:42:37 -0500

> On Jan 15, 2018, at 11:42 AM, Julian Foad <julianfoad_at_apache.org> wrote:
>
> About this new-for-1.10 API:
> [[[
> /** Reads a string from stdin until a newline or EOF is found
> *
> * @since New in 1.10.
> */
> svn_error_t *
> svn_io_stdin_readline(const char **result,
> apr_pool_t *result_pool,
> apr_pool_t *scratch_pool);
> ]]]
>
> Compare with svn_stream_readline() and svn_io_file_readline():
> * they read into a svn_stringbuf_t;
> * they have EOL and EOF params;
> * svn_io_file_readline() has max_len param;
>
> It seems to me it would be better to make this new function more similar to them.
>
> Thoughts?
>
> - Julian

I didn't look at the context but it looks like, at a bare minimum, this function needs a size of result param to avoid overrunning a buffer.
Received on 2018-01-16 03:42:43 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.