net: properly handle illegal fd/vhostfd from command line
authorJason Wang <jasowang@redhat.com>
Mon, 25 Oct 2010 05:39:59 +0000 (13:39 +0800)
committerMichael S. Tsirkin <mst@redhat.com>
Wed, 27 Oct 2010 16:54:02 +0000 (18:54 +0200)
commite78dfda842e1bbf6fcbd3b213c8c2b5017d74ddd
treeac33e75ca51852177093bd88b4d84727cf83f1a9
parent6ec2722780265b75f16c37c8d441bc97fed2be06
net: properly handle illegal fd/vhostfd from command line

When hanlding fd/vhostfd form command line through net_handle_fd_param(),
we need to check mon and return value of strtol() otherwise we could
get segmentation fault or invalid fd when user type an illegal fd/vhostfd.

This patch is based on the suggestions from
Luiz Capitulino <lcapitulino@redhat.com>.

Signed-off-by: Jason Wang <jasowang@redhat.com>
Reviewed-by: Luiz Capitulino <lcapitulino@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
net.c