Various changes to verifyObjectPCRUD():
1. Add numerous comments.
2. Check for nullity of local_context before dereferencing it.
3. If the lookup of a foreign row results in an empty result set, set
_param to NULL instead of pointing it to a JSON_NULL. (Existing code
seems to assume such a policy. This assumption was false, because
jsonObjectClone() never returns NULL.)
4. Instead of using jsonObjectClone() and then immediately destroying
the original, use jsonObjectExtractIndex() to pull an existing subobject
out of its surroundings.
5. In the loop implementing the "jump" attribute: plug a memory leak by
freeing _fparam before assigning it a new value.
6. In the loop that adds org unit contexts from a foreign row: take the
call to osrfHashGet() out of the loop condition, since its return value
is a loop invariant.
-----------
NOTE: This patch does *not* fix a known bug whereby we try to trace
foreign keys that are not present in the available row image. The result
of the bug is that all id_list calls deny access in pcrud. The same bug
can affect retrieve and search calls, if the call specifies a SELECT list
that doesn't include all the necessary foreign keys.
A fix for this bug will come later; fixing it now would make it harder to
test the current changes.
M Open-ILS/src/c-apps/oils_sql.c
git-svn-id: svn://svn.open-ils.org/ILS/trunk@16491
dcc99617-32d9-48b4-a31d-
7c20da2025e4