whisperfish / libsignal-service-rs

A Rust version of the libsignal-service-java library for communicating with Signal servers.
https://whisperfish.github.io/libsignal-service-rs/libsignal_service
GNU Affero General Public License v3.0
68 stars 31 forks source link

Fix panic for fetching group avatar #291

Closed Schmiddiii closed 8 months ago

Schmiddiii commented 8 months ago

Tracing assumed the path was always at least 4 characters long. This would panic with the empty path which can be the value of a group avatar path if no avatar is set for the group.

While this panic is easy to prevent in presage (which I also did here), this panic should still be removed from libsignal-service-rs.

(CI failure is again in nightly and most likely not my fault)

rubdos commented 8 months ago

This would panic with the empty path which can be the value of a group avatar path if no avatar is set for the group.

I don't think you should call this method when you know the avatar is not set, but I agree it shouldn't panic in that case.