]> git.ipfire.org Git - thirdparty/samba.git/commit
lib:ldb-samba: Improve calculate_popt_array_length()
authorAndreas Schneider <asn@samba.org>
Thu, 17 Dec 2020 18:16:13 +0000 (19:16 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 2 Nov 2021 21:52:16 +0000 (21:52 +0000)
commit7dd529019045949bcc5d7fbb49322868bfda52c7
treee3be192b27e975105de80626a1cbe00d873adf9f
parent68d736a73f175c949ae19a15228b7e5e4d90a610
lib:ldb-samba: Improve calculate_popt_array_length()

Note that memcmp() doesn't work well with padding bytes. So avoid it!

(gdb) ptype/o struct poptOption
/* offset    |  size */  type = struct poptOption {
/*    0      |     8 */    const char *longName;
/*    8      |     1 */    char shortName;
/* XXX  3-byte hole  */
/*   12      |     4 */    unsigned int argInfo;
/*   16      |     8 */    void *arg;
/*   24      |     4 */    int val;
/* XXX  4-byte hole  */
/*   32      |     8 */    const char *descrip;
/*   40      |     8 */    const char *argDescrip;

                           /* total size (bytes):   48 */

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
(cherry picked from commit c2c7c1f50a8acb3169e19ba4329aa78839b66def)
lib/ldb-samba/samba_extensions.c
lib/ldb/tools/cmdline.c