Skip to contentSkip to conversation

kernel/auditsc.c: fix an off-by-one

PATCH New Adrian Bunk 1 participant 1 message Jul 23, 2007 Audit

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kernel/auditsc.c: fix an off-by-one

This patch fixes an off-by-one in a BUG_ON() spotted by the Coverity checker.

---

kernel/auditsc.c renamed from kernel/auditsc.c.old +1 -1
@@ -2069,7 +2069,7 @@ int __audit_signal_info(int sig, struct 
 		axp->d.next = ctx->aux_pids;
 		ctx->aux_pids = (void *)axp;
 	}
-	BUG_ON(axp->pid_count > AUDIT_AUX_PIDS);
+	BUG_ON(axp->pid_count >= AUDIT_AUX_PIDS);
 
 	axp->target_pid[axp->pid_count] = t->tgid;
 	selinux_get_task_sid(t, &axp->target_sid[axp->pid_count]);