Message ID | 20231219062801.307-2-vinit.mehta@nxp.com (mailing list archive) |
---|---|
State | Accepted |
Commit | 60d60166e4bfae8555fb671e5a99952586cc6b56 |
Headers | show |
Series | mgmt: Fix crash after pair command | expand |
Context | Check | Description |
---|---|---|
tedd_an/pre-ci_am | success | Success |
tedd_an/CheckPatch | success | CheckPatch PASS |
tedd_an/GitLint | success | Gitlint PASS |
tedd_an/BuildEll | success | Build ELL PASS |
tedd_an/BluezMake | success | Bluez Make PASS |
tedd_an/MakeCheck | success | Bluez Make Check PASS |
tedd_an/MakeDistcheck | success | Make Distcheck PASS |
tedd_an/CheckValgrind | success | Check Valgrind PASS |
tedd_an/CheckSmatch | success | CheckSparse PASS |
tedd_an/bluezmakeextell | success | Make External ELL PASS |
tedd_an/IncrementalBuild | success | Incremental Build PASS |
tedd_an/ScanBuild | success | Scan Build PASS |
This is automated email and please do not reply to this email! Dear submitter, Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series: PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=811296 ---Test result--- Test Summary: CheckPatch PASS 0.30 seconds GitLint PASS 0.21 seconds BuildEll PASS 24.02 seconds BluezMake PASS 751.07 seconds MakeCheck PASS 11.61 seconds MakeDistcheck PASS 162.18 seconds CheckValgrind PASS 225.46 seconds CheckSmatch PASS 326.35 seconds bluezmakeextell PASS 106.28 seconds IncrementalBuild PASS 699.09 seconds ScanBuild PASS 941.41 seconds --- Regards, Linux Bluetooth
diff --git a/client/agent.c b/client/agent.c index 35b404114..ff5e57ff2 100644 --- a/client/agent.c +++ b/client/agent.c @@ -77,14 +77,17 @@ static void confirm_response(const char *input, void *user_data) { DBusConnection *conn = user_data; - if (!strcmp(input, "yes")) - g_dbus_send_reply(conn, pending_message, DBUS_TYPE_INVALID); - else if (!strcmp(input, "no")) - g_dbus_send_error(conn, pending_message, + if (pending_message != NULL) { + if (!strcmp(input, "yes")) + g_dbus_send_reply(conn, pending_message, + DBUS_TYPE_INVALID); + else if (!strcmp(input, "no")) + g_dbus_send_error(conn, pending_message, "org.bluez.Error.Rejected", NULL); - else - g_dbus_send_error(conn, pending_message, + else + g_dbus_send_error(conn, pending_message, "org.bluez.Error.Canceled", NULL); + } } static void agent_release(DBusConnection *conn) diff --git a/client/mgmt.c b/client/mgmt.c index c056d018a..2cc40a7e3 100644 --- a/client/mgmt.c +++ b/client/mgmt.c @@ -849,10 +849,16 @@ static void prompt_input(const char *input, void *user_data) &prompt.addr); break; case MGMT_EV_USER_CONFIRM_REQUEST: - if (input[0] == 'y' || input[0] == 'Y') - mgmt_confirm_reply(prompt.index, &prompt.addr); - else + if (len) { + if (input[0] == 'y' || input[0] == 'Y') + mgmt_confirm_reply(prompt.index, &prompt.addr); + else + mgmt_confirm_neg_reply(prompt.index, + &prompt.addr); + } else { mgmt_confirm_neg_reply(prompt.index, &prompt.addr); + bt_shell_set_prompt(PROMPT_ON); + } break; } }