Re: [PATCH] ash: improve / fix glob expansion

2017-01-31 Thread Denys Vlasenko
>> I plan to massage it into this - do you see any bugs? > Looks okay. I'm committing this version, yell if something wrong. hasmeta(const char *p) { static const char chars[] ALIGN1 = { '*', '?', '[', '\\', CTLQUOTEMARK, CTLESC, 0 }; for (;;) {

Re: [PATCH] ash: improve / fix glob expansion

2017-01-31 Thread Felix Fietkau
On 2017-01-31 21:29, Denys Vlasenko wrote: > On Sun, Jan 29, 2017 at 2:14 PM, Felix Fietkau wrote: >> When using musl libc glob() a very long string can cause glob() to fail, >> which leads to an out of memory error being raised by ash. >> >> This can happen easily if a very long

Re: [PATCH] ash: improve / fix glob expansion

2017-01-31 Thread Denys Vlasenko
On Sun, Jan 29, 2017 at 2:14 PM, Felix Fietkau wrote: > When using musl libc glob() a very long string can cause glob() to fail, > which leads to an out of memory error being raised by ash. > > This can happen easily if a very long quoted string contains *, even > though no glob

Re: [PATCH] ash: improve / fix glob expansion

2017-01-31 Thread Felix Fietkau
On 2017-01-31 19:42, Denys Vlasenko wrote: > On Sun, Jan 29, 2017 at 2:14 PM, Felix Fietkau wrote: >> When using musl libc glob() a very long string can cause glob() to fail, >> which leads to an out of memory error being raised by ash. > > But it works with glibc glob(), right?

Re: [PATCH] ash: improve / fix glob expansion

2017-01-31 Thread Denys Vlasenko
On Sun, Jan 29, 2017 at 2:14 PM, Felix Fietkau wrote: > When using musl libc glob() a very long string can cause glob() to fail, > which leads to an out of memory error being raised by ash. But it works with glibc glob(), right? So other programs will also be affected. Let's fix

[PATCH] ash: improve / fix glob expansion

2017-01-29 Thread Felix Fietkau
When using musl libc glob() a very long string can cause glob() to fail, which leads to an out of memory error being raised by ash. This can happen easily if a very long quoted string contains *, even though no glob expansion should ever be performed on it (since it's quoted). Fix this by