X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Flib%2Fraop.c;h=9aafe65b18ef654e01303b7060e96629862cbae3;hb=a68fedbb434cf90caea9b83d7690e5465d1272df;hp=0eaace1bbc2c2fde1d2ef2fbeae6c6a78b3fdd27;hpb=e4169f77f892fefc66a97439d295d3e09ef3e2f0;p=deb_shairplay.git diff --git a/src/lib/raop.c b/src/lib/raop.c index 0eaace1..9aafe65 100644 --- a/src/lib/raop.c +++ b/src/lib/raop.c @@ -439,18 +439,21 @@ raop_start(raop_t *raop, unsigned short *port, const char *hwaddr, int hwaddrlen return -1; } - /* Validate password */ - if (strlen(password) > MAX_PASSWORD_LEN) { - return -1; + memset(raop->password, 0, sizeof(raop->password)); + if (password) { + /* Validate password */ + if (strlen(password) > MAX_PASSWORD_LEN) { + return -1; + } + + /* Copy password to the raop structure */ + strncpy(raop->password, password, MAX_PASSWORD_LEN); } /* Copy hwaddr to the raop structure */ memcpy(raop->hwaddr, hwaddr, hwaddrlen); raop->hwaddrlen = hwaddrlen; - /* Copy password to the raop structure */ - strncpy(raop->password, password, MAX_PASSWORD_LEN); - return httpd_start(raop->httpd, port); }