FS#25536 - [dosemu] kernel string error

Attached to Project: Community Packages
Opened by Bojan Popovic (bocke) - Friday, 12 August 2011, 14:30 GMT
Last edited by Sergej Pupykin (sergej) - Monday, 15 August 2011, 09:25 GMT
Task Type Bug Report
Category Packages
Status Closed
Assigned To Sergej Pupykin (sergej)
Architecture i686
Severity High
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: /src/base/init/init.c in function version_init (line 278) makes a wrong assumption that the kernel string is X.Y.Z. That was historicallly true, but 3.0, doesn't have the Z, so atoi fail with a NULL pointer making dosemu segfault.


Additional info:
* package version(s)
1.4.0-3
* config and/or log files etc.
A simple solution was proposed on the forum: https://bbs.archlinux.org/viewtopic.php?id=124206
Attached are the patch and changed PKGBUILD based on it.

Steps to reproduce:
Run dosemu on kernel 3+
This task depends upon

Closed by  Sergej Pupykin (sergej)
Monday, 15 August 2011, 09:25 GMT
Reason for closing:  Fixed
Additional comments about closing:  (by removing running_kversion code)
Comment by Bojan Popovic (bocke) - Friday, 12 August 2011, 14:34 GMT
Oops... strtok fails with NULL pointer because atoi fails. Sorry for typing mistake. :)
Comment by Sergej Pupykin (sergej) - Monday, 15 August 2011, 08:35 GMT
It looks like running_kversion variable is never used. May be just remove this code?
Comment by Bojan Popovic (bocke) - Monday, 15 August 2011, 09:00 GMT
Seems it isn't. Beside init.c, it's also referenced in emu.h, but doesn't seem to be used in the source.

$ grep -R running_kversion *

src/base/init/init.c: running_kversion = atoi(strtok(version,".")) *1000000;
src/base/init/init.c: running_kversion += atoi(strtok(NULL,".")) *1000;
src/base/init/init.c: running_kversion += atoi(strtok(NULL,"."));
src/include/emu.h:EXTERN int running_kversion INIT(0);

Anyway, it seems the patch was accepted in upstream:
http://sourceforge.net/tracker/?func=detail&atid=457449&aid=3390615&group_id=49784

Bart marked the thread as solved so I can't add your remark or ask him about that.

Loading...