OSDN Git Service

Fix the faulty check of parameters in server_c.c:control_getcmd()
authorTakashi Iwai <tiwai@suse.de>
Wed, 30 May 2012 13:22:35 +0000 (15:22 +0200)
committerHans de Goede <hdegoede@redhat.com>
Fri, 1 Jun 2012 15:51:52 +0000 (17:51 +0200)
commit631fae8f9a1e22986d8c2beeb82295ad140d24c6
tree8638e913dbfb3b25d11a5af55097df10da9d5f4f
parentbd38dfe969aa962a6acd1c8c86f98929239a523e
Fix the faulty check of parameters in server_c.c:control_getcmd()

The check of the array size in server_c.c:control_getcmd() is wrong
as the nparmas is incremeted after the check with MAX_GETCMD_PARAMS.
Also, there are other bugs that *nparams isn't initialized when the
first token is NULL, etc.  Overall, the code is unnecessarily tricky.

This patch simplifies the code and fixes the array size check.

Bugzila: https://bugzilla.novell.com/show_bug.cgi?id=517719
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
interface/server_c.c