View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0002520 | FSSCP | Platform-Engine interaction | public | 2011-10-15 14:44 | 2011-10-16 06:12 |
Reporter | ComputerDruid | Assigned To | Echelon9 | ||
Priority | normal | Severity | crash | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Fixed in Version | 3.6.13 | ||||
Summary | 0002520: r7905 crashes when no -keyboard_layout is specified | ||||
Description | r7905 introduced the new -keyboard_layout option. However, when not specified, it causes strcmp to be called on a null pointer, which causes a segfault on my system/optimizations (Linux x86_64) | ||||
Additional Information | Recommend to first check if the option is specified before running strcmp. Please see attached patch. | ||||
Tags | No tags attached. | ||||
2011-10-15 14:44
|
fix-strcmp.patch (469 bytes)
diff --git a/code/io/key.cpp b/code/io/key.cpp index 15b05bf..c3582b8 100644 --- a/code/io/key.cpp +++ b/code/io/key.cpp @@ -115,8 +115,10 @@ void FillSDLArray () { KeyboardLayout layout = KEYBOARD_LAYOUT_DEFAULT; - if (!strcmp(Cmdline_keyboard_layout, "qwertz")) { - layout = KEYBOARD_LAYOUT_QWERTZ; + if (Cmdline_keyboard_layout) { + if (!strcmp(Cmdline_keyboard_layout, "qwertz")) { + layout = KEYBOARD_LAYOUT_QWERTZ; + } } SDLtoFS2[SDLK_0] = KEY_0; |
|
Fixed in a similar, but not quite the same, way in http://svn.icculus.org/fs2open?view=rev&revision=7906 |
Date Modified | Username | Field | Change |
---|---|---|---|
2011-10-15 14:44 | ComputerDruid | New Issue | |
2011-10-15 14:44 | ComputerDruid | File Added: fix-strcmp.patch | |
2011-10-16 06:11 | Echelon9 | Status | new => assigned |
2011-10-16 06:11 | Echelon9 | Assigned To | => Echelon9 |
2011-10-16 06:12 | Echelon9 | Note Added: 0012893 | |
2011-10-16 06:12 | Echelon9 | Status | assigned => resolved |
2011-10-16 06:12 | Echelon9 | Fixed in Version | => 3.6.13 |
2011-10-16 06:12 | Echelon9 | Resolution | open => fixed |