lkml.org 
[lkml]   [2008]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: execve errno setting on MIPS
Date

I will change the Subject line "execve exit status on MIPS" first.


David Newall <davidn <at> davidnewall.com> writes:
>
> Halesh S wrote:
> > char e2BIG[ARG_MAX+1][10];
> > ...
> > for(ind = 0; ind < ARG_MAX+1; ind++)
> > strcpy(e2BIG[ind], "helloworld");
> >
>
> Did you intend to overflow e2BIG? You're copying 11 bytes (including
> terminating NUL) into a 10 byte array.
>

My intenstion is not to overflow in string...
We can change
> > strcpy(e2BIG[ind], "helloworld");
to
strcpy(e2BIG[ind], "helloworl");

But intenstion is to generate E2BIG in
if ((ret = execve(EXE_NAME,e2BIG,envList)) == -1) {

where e2BIG array has more number arguments than ARG_MAX.

Which was possible on ARM,PPC and i386....

For the same code...I got 14 EFAULT....


Thanks,
Halesh










\
 
 \ /
  Last update: 2008-09-18 07:37    [W:0.037 / U:0.320 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site