keepassxreboot / keepassxc

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.
https://keepassxc.org/
Other
21.27k stars 1.47k forks source link

Crash when passing a wildcard to some CLI commands on Windows #5245

Closed Still34 closed 2 years ago

Still34 commented 4 years ago

Summary

If a wildcard character (*) is passed into the keepassxc-cli show or keepassxc-cli locate command, the application crashes before a password prompt is shown. The same behavior cannot be reproduced on a headless Linux system (at least for WSL)

image

Expected Behavior

  1. keepassxc-cli [show|locate] dummy.kdbx *
  2. All entries in the database are shown

Actual Behavior

  1. keepassxc-cli [show|locate] dummy.kdbx *
  2. Instant crash
ghost commented 4 years ago

ok

droidmonkey commented 4 years ago

Confirmed, the crash occurs when the help text attempts to be displayed.

droidmonkey commented 4 years ago

This is actually a Qt bug, requesting the arguments list with any number of "*" in the positional args causes a crash.

droidmonkey commented 4 years ago

Qt bug report recording the crash: https://bugreports.qt.io/browse/QTBUG-67515

This problem is actually caused by MinGW because the * is expanded to be a file list. This increases the value of argc but NOT argv and Qt reads junk data as a result causing the crash.