diff options
author | Eric Paris <eparis@redhat.com> | 2009-11-20 11:00:12 -0500 |
---|---|---|
committer | James Morris <jmorris@namei.org> | 2009-11-22 17:00:44 -0500 |
commit | 85c3b529f8ad4d65ba86b982ef050212ae7dd976 (patch) | |
tree | becd5d4d607faf5de3bf5d8470cacf715aef8f7a /scripts/selinux | |
parent | 821d35a56044e522e811f6a1e8632cc230360280 (diff) |
SELinux: header generation may hit infinite loop
If a permission name is long enough the selinux class definition generation
tool will go into a infinite loop. This is because it's macro max() is
fooled into thinking it is dealing with unsigned numbers. This patch makes
sure the macro always uses signed number so 1 > -1.
Signed-off-by: Eric Paris <eparis@redhat.com>
Signed-off-by: James Morris <jmorris@namei.org>
Diffstat (limited to 'scripts/selinux')
-rw-r--r-- | scripts/selinux/genheaders/genheaders.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/selinux/genheaders/genheaders.c b/scripts/selinux/genheaders/genheaders.c index 771b86f46194..24626968055d 100644 --- a/scripts/selinux/genheaders/genheaders.c +++ b/scripts/selinux/genheaders/genheaders.c | |||
@@ -13,7 +13,7 @@ struct security_class_mapping { | |||
13 | #include "classmap.h" | 13 | #include "classmap.h" |
14 | #include "initial_sid_to_string.h" | 14 | #include "initial_sid_to_string.h" |
15 | 15 | ||
16 | #define max(x, y) ((x > y) ? x : y) | 16 | #define max(x, y) (((int)(x) > (int)(y)) ? x : y) |
17 | 17 | ||
18 | const char *progname; | 18 | const char *progname; |
19 | 19 | ||