]> git.tuebingen.mpg.de Git - paraslash.git/commit
afs: Fix long-standing bug in add command.
authorAndre Noll <maan@systemlinux.org>
Sun, 31 Jul 2011 12:40:10 +0000 (14:40 +0200)
committerAndre Noll <maan@systemlinux.org>
Sun, 31 Jul 2011 12:40:10 +0000 (14:40 +0200)
commitb2d959ddd03c85403ee96b4a94dd505419e5b157
tree2171d18bad353063feecdb9f7aa0953400b0df62
parente10dea61fed5a67e111a641741f502765077ad7d
afs: Fix long-standing bug in add command.

Before the add command handler adds a given audio file to the database
it asks the afs process to check whether the file already exists.

The afs process looks for rows in the audio file table with path
and/or hash identical to the given file. If a match is found a
pointer to the matching row is passed from afs to the command handler.
The get_row_pointer_from_result() helper is then called by the command
handler to extract the row pointer from the result returned by afs.

However, this helper incorrectly dereferenced the pointer which caused
the command handler to examine an address rather than the content of
the address to tell whether the file already exists and whether path
or content has changed. This could lead to changed/moved files being
ignored as well as existing files being added again.

This bug was introduced in commit 0a3b9b83, back in 2008.
aft.c