tests/server: check for stream != NULL in mqttd

To avoid an assert in `fgets()` on MSVC when the test case is missing.

Bug: https://github.com/curl/curl/pull/17294#issuecomment-2867501300

Closes #17324
This commit is contained in:
Viktor Szakats 2025-05-12 12:33:35 +02:00
parent 4f055feee2
commit 144706342f
No known key found for this signature in database
GPG key ID: B5ABD165E2AEF201

View file

@ -583,6 +583,12 @@ static curl_socket_t mqttit(curl_socket_t fd)
logmsg("SUBSCRIBE to '%s' [%d]", topic, packet_id);
stream = test2fopen(testno, logdir);
if(!stream) {
error = errno;
logmsg("fopen() failed with error (%d) %s", error, strerror(error));
logmsg("Couldn't open test file %ld", testno);
goto end;
}
error = getpart(&data, &datalen, "reply", "data", stream);
if(!error) {
if(!m_config.publish_before_suback) {