]> git.tuebingen.mpg.de Git - paraslash.git/commit
touch: Refuse to set an invalid image or lyrics ID.
authorAndre Noll <maan@tuebingen.mpg.de>
Sat, 26 Mar 2016 22:27:09 +0000 (22:27 +0000)
committerAndre Noll <maan@tuebingen.mpg.de>
Tue, 4 Oct 2016 08:58:37 +0000 (10:58 +0200)
commit38eaaecc9180ddcfd9780a72d977d7a7d66f0c96
tree49269e58d36ac1bd0d939f24d56fdd24e45f03a1
parent33692c33f2effa9620064aec44c6196a8d830d05
touch: Refuse to set an invalid image or lyrics ID.

This makes the callback of the touch command fail the command if the
given ID does not exist in the corresponding blob table.

To this aim we call blob_get_name_by_id() to look up the ID. Since
we are not interested in the name, the function now allows a NULL
result pointer in which case it only checks whether the ID is valid.

With this patch applied the attempt to set an invalid image or lyrics
ID results in an error message like this:

invalid image ID: 456565
remote: key not found in rbtree
main: command failed
aft.c
blob.c