-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
Closed
Labels
Description
Problem description
Malformed \uxxxx tokens trigger unhandled exception during parsing of extra keys configuration.
As ~/.termux/termux.properties is loaded even under failsafe session, parser bug puts application into denial-of-service condition where user will have to go into Android settings and clear data to restore normal behaviour.
Steps to reproduce
Save all important data on /sdcard - Termux app will be locked once you follow these steps.
Edit your ~/.termux/termux.properties and add this:
extra-keys = [['\u27:wq']]
and run termux-reload-settings.
Expected behavior
- Application shouldn't crash but display a message about problems with configuration.
- Application in failsafe mode should ignore any configuration, so parser bugs like this one won't prevent user from accessing the environment.
Additional information
Android log:
06-06 20:45:09.411 28676 28676 E AndroidRuntime: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.termux/com.termux.app.TermuxActivity}: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2957)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3032)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread.-wrap11(Unknown Source:0)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1696)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.os.Handler.dispatchMessage(Handler.java:105)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.os.Looper.loop(Looper.java:164)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread.main(ActivityThread.java:6944)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at java.lang.reflect.Method.invoke(Native Method)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:327)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1374)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: Caused by: java.lang.IllegalArgumentException: Malformed \uxxxx encoding.
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at java.util.Properties.loadConvert(Properties.java:573)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at java.util.Properties.load0(Properties.java:389)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at java.util.Properties.load(Properties.java:312)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at com.termux.app.TermuxPreferences.reloadFromProperties(TermuxPreferences.java:162)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at com.termux.app.TermuxPreferences.<init>(TermuxPreferences.java:84)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at com.termux.app.TermuxActivity.onCreate(TermuxActivity.java:202)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.Activity.performCreate(Activity.java:7183)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1220)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2910)
06-06 20:45:09.411 28676 28676 E AndroidRuntime: ... 9 more