Require topics>0 in mosquitto_[un]subscribe*().

pull/2223/merge
Roger A. Light 3 years ago
parent 4093e717f9
commit 25bc6f3cf4

@ -134,6 +134,10 @@ Client library:
`%u` patterns for client id / username substitution.
- Performance: reduce memory allocations when sending packets.
- Reintroduce threading support for Windows. Closes #1509.
- `mosquitto_subscribe*()` now returns MOSQ_ERR_INVAL if an empty string is
passed as a topic filter.
- `mosquitto_unsubscribe*()` now returns MOSQ_ERR_INVAL if an empty string is
passed as a topic filter.
Clients:
- Add `-W` timeout support to Windows.

@ -69,6 +69,9 @@ int mosquitto_subscribe_multiple(struct mosquitto *mosq, int *mid, int sub_count
for(i=0; i<sub_count; i++){
if(mosquitto_sub_topic_check(sub[i])) return MOSQ_ERR_INVAL;
slen = (int)strlen(sub[i]);
if(slen == 0){
return MOSQ_ERR_INVAL;
}
if(mosquitto_validate_utf8(sub[i], slen)) return MOSQ_ERR_MALFORMED_UTF8;
remaining_length += 2+(uint32_t)slen + 1;
}

@ -67,6 +67,7 @@ int mosquitto_unsubscribe_multiple(struct mosquitto *mosq, int *mid, int sub_cou
for(i=0; i<sub_count; i++){
if(mosquitto_sub_topic_check(sub[i])) return MOSQ_ERR_INVAL;
slen = (int)strlen(sub[i]);
if(slen == 0) return MOSQ_ERR_INVAL;
if(mosquitto_validate_utf8(sub[i], slen)) return MOSQ_ERR_MALFORMED_UTF8;
remaining_length += 2U + (uint32_t)slen;
}

Loading…
Cancel
Save