Mario Charest
04/14/2008 12:08 PM
post6733
|
No biggy but line 1054 in pidin_proc.c (166123)
for (i = 0; args[i] && i < sizeof args / sizeof args[0]; i++) {
Should read
for (i = 0; i < sizeof args / sizeof args[0] && args[i]; i++) {
|
|
|
Stephane Boucher
04/14/2008 12:21 PM
post6734
|
On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
>
> No biggy but line 1054 in pidin_proc.c (166123)
>
> for (i = 0; args[i] && i < sizeof args / sizeof args[0]; i++)
> {
>
> Should read
>
> for (i = 0; i < sizeof args / sizeof args[0] && args[i]; i++)
> {
Good catch. Thanks.
|
|
|
Brian K Hlady(deleted)
04/14/2008 12:34 PM
post6737
|
Care to explain for those of us who are missing the point? Namely, me. =)
Thanks and cheers,
-Brian
> -----Original Message-----
> From: Stephane Boucher [mailto:sboucher@qnx.com]
> Sent: Monday, April 14, 2008 12 22
> To: ostech-core_os
> Subject: Re: pidin
>
> On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
> >
> > No biggy but line 1054 in pidin_proc.c (166123)
> >
> > for (i = 0; args[i] && i < sizeof args / sizeof
> args[0]; i++)
> > {
> >
> > Should read
> >
> > for (i = 0; i < sizeof args / sizeof args[0] &&
> args[i]; i++)
> > {
>
> Good catch. Thanks.
>
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post6734
>
|
|
|
Stephane Boucher
04/14/2008 12:38 PM
post6740
|
On Mon, 2008-04-14 at 12:34 -0400, Brian Hlady wrote:
> Care to explain for those of us who are missing the point? Namely, me.
> =)
>
You want to make sure 'i' is valid before you use it to access the
array. There's a theoretical possibility that you might fault accessing
argv[i] if is beyond the end of the array.
> Thanks and cheers,
> -Brian
>
> > -----Original Message-----
> > From: Stephane Boucher [mailto:sboucher@qnx.com]
> > Sent: Monday, April 14, 2008 12 22
> > To: ostech-core_os
> > Subject: Re: pidin
> >
> > On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
> > >
> > > No biggy but line 1054 in pidin_proc.c (166123)
> > >
> > > for (i = 0; args[i] && i < sizeof args / sizeof
> > args[0]; i++)
> > > {
> > >
> > > Should read
> > >
> > > for (i = 0; i < sizeof args / sizeof args[0] &&
> > args[i]; i++)
> > > {
> >
> > Good catch. Thanks.
> >
> >
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post6734
> >
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post6737
>
|
|
|
Brian K Hlady(deleted)
04/14/2008 12:55 PM
post6744
|
Ahh, thanks for clearing that up. It's very much appreciated.
Cheers,
-Brian
> -----Original Message-----
> From: Stephane Boucher [mailto:sboucher@qnx.com]
> Sent: Monday, April 14, 2008 12 38
> To: ostech-core_os
> Subject: RE: pidin
>
> On Mon, 2008-04-14 at 12:34 -0400, Brian Hlady wrote:
> > Care to explain for those of us who are missing the point?
> Namely, me.
> > =)
> >
>
> You want to make sure 'i' is valid before you use it to access the
> array. There's a theoretical possibility that you might
> fault accessing
> argv[i] if is beyond the end of the array.
>
> > Thanks and cheers,
> > -Brian
> >
> > > -----Original Message-----
> > > From: Stephane Boucher [mailto:sboucher@qnx.com]
> > > Sent: Monday, April 14, 2008 12 22
> > > To: ostech-core_os
> > > Subject: Re: pidin
> > >
> > > On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
> > > >
> > > > No biggy but line 1054 in pidin_proc.c (166123)
> > > >
> > > > for (i = 0; args[i] && i < sizeof args / sizeof
> > > args[0]; i++)
> > > > {
> > > >
> > > > Should read
> > > >
> > > > for (i = 0; i < sizeof args / sizeof args[0] &&
> > > args[i]; i++)
> > > > {
> > >
> > > Good catch. Thanks.
> > >
> > >
> > >
> > > _______________________________________________
> > > OSTech
> > > http://community.qnx.com/sf/go/post6734
> > >
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post6737
> >
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post6740
>
|
|
|
Thomas Fletcher
04/15/2008 8:12 PM
post6859
|
On Mon, Apr 14, 2008 at 12:34 PM, Brian K Hlady <bhlady@qnx.com> wrote:
> Care to explain for those of us who are missing the point? Namely, me. =)
>
If you are going to check the bounds, you should probably not dereference it
before you do so. In this case the check doesn't matter since it is more of
an early out rather than a limit on the bounds, but you know ... things
happen.
Thomas
>
> > -----Original Message-----
> > From: Stephane Boucher [mailto:sboucher@qnx.com]
> > Sent: Monday, April 14, 2008 12 22
> > To: ostech-core_os
> > Subject: Re: pidin
> >
> > On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
> > >
> > > No biggy but line 1054 in pidin_proc.c (166123)
> > >
> > > for (i = 0; args[i] && i < sizeof args / sizeof
> > args[0]; i++)
> > > {
> > >
> > > Should read
> > >
> > > for (i = 0; i < sizeof args / sizeof args[0] &&
> > args[i]; i++)
> > > {
> >
> > Good catch. Thanks.
> >
> >
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post6734
> >
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post6737
>
>
|
|
|
Brian K Hlady(deleted)
04/16/2008 9:21 AM
post6896
|
I seem to have lazily evaluated the lazy evaluation. =)
Thanks Thomas.
> -----Original Message-----
> From: Thomas Fletcher [mailto:tfletche@gmail.com]
> Sent: Tuesday, April 15, 2008 20 12
> To: ostech-core_os
> Subject: Re: pidin
>
> On Mon, Apr 14, 2008 at 12:34 PM, Brian K Hlady
> <bhlady@qnx.com> wrote:
>
> > Care to explain for those of us who are missing the point?
> Namely, me. =)
> >
> If you are going to check the bounds, you should probably not
> dereference it
> before you do so. In this case the check doesn't matter
> since it is more of
> an early out rather than a limit on the bounds, but you know
> ... things
> happen.
>
> Thomas
>
>
> >
> > > -----Original Message-----
> > > From: Stephane Boucher [mailto:sboucher@qnx.com]
> > > Sent: Monday, April 14, 2008 12 22
> > > To: ostech-core_os
> > > Subject: Re: pidin
> > >
> > > On Mon, 2008-04-14 at 12:08 -0400, Mario Charest wrote:
> > > >
> > > > No biggy but line 1054 in pidin_proc.c (166123)
> > > >
> > > > for (i = 0; args[i] && i < sizeof args / sizeof
> > > args[0]; i++)
> > > > {
> > > >
> > > > Should read
> > > >
> > > > for (i = 0; i < sizeof args / sizeof args[0] &&
> > > args[i]; i++)
> > > > {
> > >
> > > Good catch. Thanks.
> > >
> > >
> > >
> > > _______________________________________________
> > > OSTech
> > > http://community.qnx.com/sf/go/post6734
> > >
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post6737
> >
> >
>
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post6859
>
|
|
|
Yao Zhao(deleted)
04/30/2008 2:25 PM
post7516
|
I would expect that lint can catch this but no?
|
|
|
Mario Charest
04/30/2008 10:19 PM
post7538
|
pclint cought it.
-----Original Message-----
From: Yao Zhao [mailto:yzhao@qnx.com]
Sent: Wednesday, April 30, 2008 2:26 PM
To: ostech-core_os
Subject: Re: RE: pidin
I would expect that lint can catch this but no?
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post7516
|
|
|
Yao Zhao(deleted)
04/30/2008 10:37 PM
post7540
|
> pclint cought it.
>
> -----Original Message-----
> From: Yao Zhao [mailto:yzhao@qnx.com]
> Sent: Wednesday, April 30, 2008 2:26 PM
> To: ostech-core_os
> Subject: Re: RE: pidin
>
> I would expect that lint can catch this but no?
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post7516
>
that is it:)
but we do run lint on kernel source so maybe we turned some warning off:(
|
|
|
Chris Travis
05/01/2008 8:06 AM
post7543
|
We run lint on services/system and lib/c
-----Original Message-----
From: Yao Zhao
Sent: Wednesday, April 30, 2008 10:38 PM
To: ostech-core_os
Subject: Re: RE: RE: pidin
> pclint cought it.
>
> -----Original Message-----
> From: Yao Zhao [mailto:yzhao@qnx.com]
> Sent: Wednesday, April 30, 2008 2:26 PM
> To: ostech-core_os
> Subject: Re: RE: pidin
>
> I would expect that lint can catch this but no?
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post7516
>
that is it:)
but we do run lint on kernel source so maybe we turned some warning off:(
_______________________________________________
OSTech
http://community.qnx.com/sf/go/post7540
|
|
|
Yao Zhao(deleted)
05/05/2008 12:48 PM
post7676
|
> We run lint on services/system and lib/c
>
> -----Original Message-----
> From: Yao Zhao
> Sent: Wednesday, April 30, 2008 10:38 PM
> To: ostech-core_os
> Subject: Re: RE: RE: pidin
>
> > pclint cought it.
> >
> > -----Original Message-----
> > From: Yao Zhao [mailto:yzhao@qnx.com]
> > Sent: Wednesday, April 30, 2008 2:26 PM
> > To: ostech-core_os
> > Subject: Re: RE: pidin
> >
> > I would expect that lint can catch this but no?
> >
> > _______________________________________________
> > OSTech
> > http://community.qnx.com/sf/go/post7516
> >
>
>
> that is it:)
> but we do run lint on kernel source so maybe we turned some warning off:(
>
> _______________________________________________
> OSTech
> http://community.qnx.com/sf/go/post7540
oh! it is pidin source, I miss that :)
|
|
|
|