bug-hurd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Truncated filenames in struct directs returned from dir_readdir


From: Andrew Eggenberger
Subject: Re: Truncated filenames in struct directs returned from dir_readdir
Date: Mon, 19 Apr 2021 18:27:55 -0500

That worked. Thank you.

Andrew Eggenberger


On Mon, Apr 19, 2021 at 6:18 PM Samuel Thibault <samuel.thibault@gnu.org> wrote:
Andrew Eggenberger, le dim. 18 avril 2021 20:27:09 -0500, a ecrit:
>   while(i++ < amt){
>     d = *(struct direct*)dirents;

That cannot work: d_name is a flexible array member, so the struct copy
wouldn't copy everything. Make this

>   struct direct *d;
>     d = (struct direct*)dirents;

and that'll work.

Also, you need to initialize dirents to NULL and dataCnt to 0, because
RPCs try to reuse the buffers you pass them.

Samuel

reply via email to

[Prev in Thread] Current Thread [Next in Thread]