[hackers] [scc] [cc2] Improve overflow check in cc2 || Roberto E. Vargas Caballero

From: <git_AT_suckless.org>
Date: Wed, 5 Oct 2016 14:07:04 +0200 (CEST)

commit cff1e86a7f61535db92a132d29fce0e805c8e529
Author: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
AuthorDate: Wed Oct 5 14:06:35 2016 +0200
Commit: Roberto E. Vargas Caballero <k0ga_AT_shike2.com>
CommitDate: Wed Oct 5 14:06:35 2016 +0200

    [cc2] Improve overflow check in cc2

diff --git a/cc2/symbol.c b/cc2/symbol.c
index 271883b..9b1fdbc 100644
--- a/cc2/symbol.c
+++ b/cc2/symbol.c
_AT_@ -50,7 +50,7 @@ getsym(unsigned id)
         Symbol **htab, *sym;
         static unsigned short num;
 
- if (id > USHRT_MAX)
+ if (id >= USHRT_MAX)
                 error(EBADID);
 
         htab = &symtab[id & NR_SYMHASH-1];
Received on Wed Oct 05 2016 - 14:07:04 CEST

This archive was generated by hypermail 2.3.0 : Wed Oct 05 2016 - 14:12:22 CEST