[Top][All Lists]

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

Re: KVC bug

From: Richard Frith-Macdonald
Subject: Re: KVC bug
Date: Wed, 27 Feb 2002 09:26:34 +0000

On Wednesday, February 27, 2002, at 08:46 AM, Manuel Guesdon wrote:


There's a bug in KVC.
When constructing setValue:forKey: method name, the method in has garbage at the end (after the ':').
In NSKeyValueCoding.m, I think there should be a
      buf[size+5] = '\0';
after each
         buf[size+4] = ':';

Thanks ... fixed for the initial setup in takeValue:forKey and takeStoredValue:forKey:
I don't think there is anywhere else that needs it is there?

BTW, is it possible to use strncpy instead of strcpy each time it's possible to try to minimize buffer overflows, even if
size seems to be well known ?

Well, if size isn't well known the code will fail anyway, so there doesn't seem much point.

PS. Also implemented MacOS-X compatible KVC behavior in NSDictionary.m

reply via email to

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