mirror of
https://gitlab.com/apparmor/apparmor.git
synced 2025-03-04 08:24:42 +01:00
parser: fix issues appointed by coverity
Fix issues introduced in coverity's snapshots 75887, 70858 and 75429. - CID 353483: Uninitialized pointer field (UNINIT_CTOR) - CID 349572: Unsigned compared against 0 (NO_EFFECT) Signed-off-by: Georgia Garcia <georgia.garcia@canonical.com>
This commit is contained in:
parent
2fc80487f7
commit
f9527d2113
3 changed files with 3 additions and 5 deletions
|
@ -29,8 +29,6 @@
|
|||
class all_rule: public prefix_rule_t {
|
||||
void move_conditionals(struct cond_entry *conds);
|
||||
public:
|
||||
char *label;
|
||||
|
||||
all_rule(void): prefix_rule_t(RULE_TYPE_ALL) { }
|
||||
|
||||
virtual bool valid_prefix(const prefixes &p, const char *&error) {
|
||||
|
|
|
@ -344,8 +344,8 @@ bool parse_port_number(const char *port_entry, uint16_t *port) {
|
|||
char *eptr;
|
||||
unsigned long port_tmp = strtoul(port_entry, &eptr, 10);
|
||||
|
||||
if (port_tmp >= 0 && port_entry != eptr &&
|
||||
*eptr == '\0' && port_tmp <= UINT16_MAX) {
|
||||
if (port_entry != eptr && *eptr == '\0' &&
|
||||
port_tmp <= UINT16_MAX) {
|
||||
*port = port_tmp;
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ public:
|
|||
/* empty constructor used only for the profile to access
|
||||
* static elements to maintain compatibility with
|
||||
* AA_CLASS_NET */
|
||||
network_rule(): dedup_perms_rule_t(AA_CLASS_NETV8) { }
|
||||
network_rule(): dedup_perms_rule_t(AA_CLASS_NETV8), label(NULL) { }
|
||||
network_rule(perms_t perms_p, struct cond_entry *conds,
|
||||
struct cond_entry *peer_conds);
|
||||
network_rule(perms_t perms_p, const char *family, const char *type,
|
||||
|
|
Loading…
Add table
Reference in a new issue