GNOME Bugzilla – Bug 603909
Unconditionally uses PATH_MAX which is undefined on some OSes
Last modified: 2009-12-17 00:01:47 UTC
Created attachment 149202 [details] [review] Stop using PATH_MAX as it's undefined on some OSes Hi, gnobots uses PATH_MAX unconditionally, which is undefined on OSes that don't have a max path limit (e.g. the Hurd). - In one of the two places, it's used to read a config file (and not a path!). It could cause buffer overflows if PATH_MAX was smaller than the 256 bytes that can be read into the buffer... but anyway that PATH_MAX usage is weird and since there's a 256 hardcoded there I've made the buffer 256 bytes long too. - The other usage is to return the config name. If the config name was returned unmodified, it could return it directly and there would be no problem, but since it does, a solution is to return a new string that the caller must free (which is what this patch does).
Fixed on gnome-2-28 and master; thanks!