bug-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Off by 1 problem


From: Andrew Ruder
Subject: Off by 1 problem
Date: Thu, 19 Jun 2003 03:24:05 -0500
User-agent: Mutt/1.5.4i

In Additions/Unicode.m
Line 326, you have
    326       encodings = objc_malloc(sizeof(NSStringEncoding) *
        encTableSize);
This should be objc_malloc(sizeof(NSStringEncoding) * (encTableSize
   + 1);

Setting encodings[pos] = 0; could potentially write to non-allocated
memory if all encodings are supported.  Or at least afaict.
-- 
Andrew Ruder




reply via email to

[Prev in Thread] Current Thread [Next in Thread]