[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Nasty off by one bug in gdomap.c
From: |
Wim Oudshoorn |
Subject: |
Nasty off by one bug in gdomap.c |
Date: |
Wed, 16 Jun 2004 16:27:56 +0200 |
User-agent: |
Mutt/1.4.1i |
We encountered random crashes in gdomap (after extensive use).
After some investigation it turned out there is a off by one
bug in gdomap.c.
The bug is in the function: map_add
I will commit the following patch immediately.
Index: gdomap.c
===================================================================
RCS file: /cvsroot/gnustep/gnustep/core/base/Tools/gdomap.c,v
retrieving revision 1.83
diff -u -r1.83 gdomap.c
--- gdomap.c 22 May 2004 03:16:01 -0000 1.83
+++ gdomap.c 16 Jun 2004 14:21:13 -0000
@@ -655,7 +655,7 @@
m->svc = (t & GDO_SVC_MASK);
memcpy(m->name, n, l);
- if (map_used >= map_size)
+ if (map_used + 1 >= map_size)
{
if (map_size)
{
Wim Oudshoorn.
- Nasty off by one bug in gdomap.c,
Wim Oudshoorn <=