19 Jan
2011
19 Jan
'11
5:35 p.m.
On Wed, Jan 19, 2011 at 06:17:40PM +0100, bugzilla@bugzilla.balabit.com wrote:
--- Comment #1 from Arkadiusz MiĆkiewicz <arekm@maven.pl> 2011-01-19 18:17:40 --- Solution used in PLD/Linux: http://cvs.pld-linux.org/cgi-bin/cvsweb/packages/syslog-ng/cap_syslog.patch
+ sscanf(uts.release, "%d.%d.%d", &x, &y, &z); + kernel_version = LINUX_VERSION(x, y, z); That patch is not resilient in format changes in the string. If I take stuff out or add weird stuff then *.scanf functions will corrupt the stack. It would be better to use a regex with capture groups and check for the right count of them, then pass that to the version macro. Matthew.