bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH,HURD] hurd: compliance fixes for getlogin_r


From: Pino Toscano
Subject: Re: [PATCH,HURD] hurd: compliance fixes for getlogin_r
Date: Sat, 28 Apr 2012 14:03:12 +0200
User-agent: KMail/1.13.7 (Linux/3.2.0-2-amd64; KDE/4.7.4; x86_64; ; )

Alle sabato 28 aprile 2012, Roland McGrath ha scritto:
> You can just use string_t and no need for the XXX comment.

Fixed. (I initially made my changes as less intrusive as possible.)

> libc code can use C99 freely these days, so use an inline
> initializing declaration rather than pre-declaring a new variable.

Hm ok; is it bad if I leave them as it is, for now?

> I don't think there's any need to iniitalize the result buffer.  We
> trust the RPC stubs to return a properly-terminated string on
> success, and if they didn't then that wouldn't necessarily catch it
> anyway.  If you want that sort of paranoia, use __strnlen (login,
> sizeof login - 1).
> 
> If you've already called strlen/strnlen then don't use strncpy,
> just use memcpy with the known length.

Fixed.

Attached there is the updated patch.

-- 
Pino Toscano

Attachment: hurd_getlogin_r.diff
Description: Text Data

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]