mirror of
https://github.com/eclipse/mosquitto.git
synced 2025-05-08 16:52:13 +08:00
Shared subs must have a valid topic
This commit is contained in:
parent
71ddbabb00
commit
732b8eb584
@ -97,7 +97,7 @@ int sub__topic_tokenise(const char *subtopic, char **local_sub, char ***topics,
|
||||
}
|
||||
|
||||
if(!strcmp((*topics)[0], "$share")){
|
||||
if(count < 2){
|
||||
if(count < 3 || (count == 3 && strlen((*topics)[2]) == 0)){
|
||||
mosquitto__free(*local_sub);
|
||||
mosquitto__free(*topics);
|
||||
return MOSQ_ERR_PROTOCOL;
|
||||
|
@ -219,6 +219,14 @@
|
||||
{"type":"send", "payload":"82 0B 1234 00 0001 70 00 0001 71 00"},
|
||||
{"type":"recv", "payload":"90 05 1234 00 00 00"}
|
||||
]},
|
||||
{ "name": "82 shared sub with no topic part 1", "ver":5, "msgs": [
|
||||
{"type":"send", "payload":"82 0F 1234 00 0009 2473686172652F702F 00"},
|
||||
{"type":"recv", "payload":"E0 01 82"}
|
||||
]},
|
||||
{ "name": "82 shared sub with no topic part 2", "ver":5, "msgs": [
|
||||
{"type":"send", "payload":"82 0E 1234 00 0008 2473686172652F70 00"},
|
||||
{"type":"recv", "payload":"E0 01 82"}
|
||||
]},
|
||||
{ "name": "82 shared sub with no local set", "ver":5, "msgs": [
|
||||
{"type":"send", "payload":"82 10 1234 00 000A 2473686172652F702F70 04"},
|
||||
{"type":"recv", "payload":"E0 01 82"}
|
||||
|
Loading…
x
Reference in New Issue
Block a user