Re: [hackers] [sbase][patch]find: copy path before using basename

From: FRIGN <dev_AT_frign.de>
Date: Tue, 4 Oct 2016 00:10:50 +0200

On Mon, 3 Oct 2016 15:04:16 -0700
Evan Gates <evan.gates_AT_gmail.com> wrote:

> "The basename() function may modify the string pointed to by path..."
> Thanks POSIX.

> + char path[strlen(arg->path)+1];
> + strcpy(path, arg->path);
> + return !fnmatch((char *)arg->extra.p, path, 0);

Please don't use VLA's. Use estrdup() in this case.

Cheers

FRIGN

-- 
FRIGN <dev_AT_frign.de>
Received on Tue Oct 04 2016 - 00:10:50 CEST

This archive was generated by hypermail 2.3.0 : Tue Oct 04 2016 - 00:12:44 CEST