[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Truncated filenames in struct directs returned from dir_readdir
From: |
Samuel Thibault |
Subject: |
Re: Truncated filenames in struct directs returned from dir_readdir |
Date: |
Tue, 20 Apr 2021 01:18:11 +0200 |
User-agent: |
NeoMutt/20170609 (1.8.3) |
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