[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] kern: fix mig_strncpy
From: |
Justus Winter |
Subject: |
Re: [PATCH] kern: fix mig_strncpy |
Date: |
Mon, 24 Feb 2014 09:34:35 +0100 |
User-agent: |
alot/0.3.4 |
Quoting Samuel Thibault (2014-02-22 16:53:11)
> Justus Winter, le Sat 22 Feb 2014 16:17:13 +0100, a écrit :
> > Quoting Samuel Thibault (2014-02-22 15:37:29)
> > > Justus Winter, le Sat 22 Feb 2014 11:25:14 +0100, a écrit :
> > > > * kern/ipc_mig.c (mig_strncpy): Do not zero-terminate the destination
> > > > string. Return length of destination string.
> > >
> > > Well, that calls for some rationale :)
> > >
> > > I guess this is related with the other, MIG change? I.e. that this
> > > modified version of kernel mig_strncpy depends on the fixed MIG
> > > behavior?
> >
> > No. It's just that the version in mach did not return anything (and
> > thus I believe that sending such a string from the kernel would never
> > have worked).
>
> > The change in semantics is to make it behave like the version in the
> > glibc (and like strncpy in general).
>
> Ok, but that contradicts the previous "OUGHT" comment :) And changing
> the behavior means callers would get potentially broken. AIUI, the only
> callers are the ones from mig-generated stubs ?
Yes. And furthermore, since mig_strncpy is supposed to return the
string length (and it didn't), any use within the kernel was probably
not working before.
Justus