This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PING][PATCH v2] Remove check for NULL buffer passed to `ptsname_r'


On Wed, Jun 7, 2017 at 10:09 AM, Arjun Shankar <arjun.is@lostca.se> wrote:
> On Wed, Jun 07, 2017 at 09:39:40AM -0400, Zack Weinberg wrote:
>>
>> Is this function documented in our manual (manual/*.texi)? If so,
>> please update that.
>
> The function is documented, but there is no reference to EINVAL and no
> hint that a NULL buf is handled in any way. Here is the relevant text
> (source is in manual/terminal.texi):
>
>>  -- Function: int ptsname_r (int FILEDES, char *BUF, size_t LEN)
>>      Preliminary: | MT-Safe | AS-Unsafe heap/bsd | AC-Unsafe mem fd |
>>      *Note POSIX Safety Concepts::.
>>
>>      The ptsname_r function is similar to the ptsname function
>>      except that it places its result into the user-specified buffer
>>      starting at BUF with length LEN.
>>
>>      This function is a GNU extension.
>
> Given this, I propose that we leave the this section unchanged.

I agree.  We don't normally bother saying that passing a null pointer
to a function may cause a crash - in fact, it's the other way around,
we specifically document when null *is* allowed.

>> OK with that change.  I don't think we need a copyright assignment for
>> a change that deletes seven lines of code and adds none.
>
> Even otherwise, I have an assignment on file, and I recently got commit
> access in git :)

Oh, sorry about that.  I didn't recognize your name.

zw


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]