[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:
Hi,
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
- KVC bug, Manuel Guesdon, 2002/02/27
- Re: KVC bug,
Richard Frith-Macdonald <=