2019-10-21 18:39 EDT


View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002520FSSCPPlatform-Engine interactionpublic2011-10-16 02:12
ReporterComputerDruid 
Assigned ToEchelon9 
PrioritynormalSeveritycrashReproducibilityalways
StatusresolvedResolutionfixed 
Product Version 
Target VersionFixed in Version3.6.13 
Summary0002520: r7905 crashes when no -keyboard_layout is specified
Descriptionr7905 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 InformationRecommend to first check if the option is specified before running strcmp.

Please see attached patch.
TagsNo tags attached.
Attached Files
  • patch file icon fix-strcmp.patch (469 bytes) 2011-10-15 10:44 -
    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;
    
    patch file icon fix-strcmp.patch (469 bytes) 2011-10-15 10:44 +

-Relationships
+Relationships

-Notes

~0012893

Echelon9 (developer)

Fixed in a similar, but not quite the same, way in http://svn.icculus.org/fs2open?view=rev&revision=7906
+Notes

-Issue History
Date Modified Username Field Change
2011-10-15 10:44 ComputerDruid New Issue
2011-10-15 10:44 ComputerDruid File Added: fix-strcmp.patch
2011-10-16 02:11 Echelon9 Status new => assigned
2011-10-16 02:11 Echelon9 Assigned To => Echelon9
2011-10-16 02:12 Echelon9 Note Added: 0012893
2011-10-16 02:12 Echelon9 Status assigned => resolved
2011-10-16 02:12 Echelon9 Fixed in Version => 3.6.13
2011-10-16 02:12 Echelon9 Resolution open => fixed
+Issue History