← Commit list

5e62a3d01

Denys Vlasenko
Denys Vlasenko
2015-01-03
SUCCESS Duration: 146s

Subject

libpwdgrp: use a better estimate of max struct size

Binary

No binary (build failed)

Architecture & Compiler Flags

Architecture: x86_64-linux-gnu Compiler: gcc (Ubuntu 11.4.0-1ubuntu1~22.04.3) 11.4.0

—

Build Log

(log yok)

Commit Diff GitHub →

libpwdgrp/pwd_grp.c+4 -5
@@ -45,11 +45,10 @@ struct passdb {
uint8_t numfields;
FILE *fp;
char *malloced;
- char struct_result[0
- | sizeof(struct passwd)
- | sizeof(struct group)
- IF_USE_BB_SHADOW( | sizeof(struct spwd) )
- /* bitwise OR above is poor man's max(a,b,c) */
+ char struct_result[
+ /* Should be max(sizeof passwd,group,spwd), but this will do: */
+ IF_NOT_USE_BB_SHADOW(sizeof(struct passwd))
+ IF_USE_BB_SHADOW(sizeof(struct spwd))
];
};