MetPX / sarrac

C implementation of (a subset of) Sarracenia (large scale file transfer utility)
GNU General Public License v2.0
4 stars 1 forks source link

when relPath is empty, post can publish invalid messages with corrupt topic. #148

Closed petersilva closed 4 months ago

petersilva commented 4 months ago

there is logic that references through some invalid pointer arithmetic when dealing with the root of a directory being published, application can put unvalid/undefined characters in the topic header of the message, and post it.

Here is a snapshot seen on the broker of the message. Note the topic with the ?? after the standardish v03.post topic:

Screenshot 2024-07-17 160020

when received by the python implementation, the result is:

2024-07-17 15:32:50,627 [WARNING] sarracenia.moth.amqp getNewMessage failed q_tfeed.subscribe.cdnld_f21.peter_SSC-5CD2310S60_43670017: 'utf-8' codec can't decode byte 0xad in position 9: invalid start byte
2024-07-17 15:32:50,627 [WARNING] sarracenia.moth.amqp getNewMessage lost connection to broker
petersilva commented 4 months ago

This is causing some flow tests to fail because they all publish a tree starting from the root, shows up since directories are a thing, and since relPath is always relative.