[PATCH v2 10/10] raop: Fix potential NULL dereference

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



'realm' is mandatory

Signed-off-by: Peter Meerwald-Stadler <pmeerw at pmeerw.net>
---
 src/modules/raop/raop-client.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/raop/raop-client.c b/src/modules/raop/raop-client.c
index d329a09..5248691 100644
--- a/src/modules/raop/raop-client.c
+++ b/src/modules/raop/raop-client.c
@@ -1254,13 +1254,13 @@ static void rtsp_auth_cb(pa_rtsp_client *rtsp, pa_rtsp_state_t state, pa_rtsp_st
                     pa_xfree(token);
                 }
 
-                if (pa_safe_streq(mth, "Basic")) {
+                if (pa_safe_streq(mth, "Basic") && realm) {
                     rtrim_char(realm, '\"');
 
                     pa_raop_basic_response(DEFAULT_USER_NAME, c->password, &response);
                     ath = pa_sprintf_malloc("Basic %s",
                         response);
-                } else if (pa_safe_streq(mth, "Digest")) {
+                } else if (pa_safe_streq(mth, "Digest") && realm && nonce) {
                     rtrim_char(realm, '\"');
                     rtrim_char(nonce, '\"');
 
-- 
2.7.4



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux