ONEDC/obix — pull request #72 by Qingtao-Cao (2014-10-14 07:02:53+00:00)
Title: Perform basic sanity checks in signUp handler - 2nd try

This fixes Issue#69 recorded in the oBIX github repo. The root cause is
that if the href in the signUp device is an empty string, dirname returns
"." and such string should NOT be freed by the application or otherwise
it segfaults.

Before any node is added to the global DOM tree, sanity checks should have
been properly done on its href. Furthermore, as for the signUp handler, all
devices should go to the device lobby.

Valgrind tests passed when trying to sign up a device with following
invalid hrefs:
. "", empty string
. "/",
. any whitespace character in any position
. any '.' in any position
. more than one consecutive slashes
. outside of device lobby, such as "/obix/elsewhere/"

Instead of segfaults, oBIX server return an error contract gracefully.