[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] Re: [PATCH V2] xenconsole: add file lock to xenconsole



On 05/27/2011 05:16 AM, Yufang Zhang wrote:
@@ -280,6 +302,7 @@ int main(int argc, char **argv)
        int spty, xsfd;
        struct xs_handle *xs;
        char *end;
+       char buf[100];
        console_type type = CONSOLE_INVAL;

        while((ch = getopt_long(argc, argv, sopt, lopt,&opt_ind)) != -1) {
@@ -368,6 +391,13 @@ int main(int argc, char **argv)
                exit(EINVAL);
        }

+       /* Make sure only one console is attached to guest */
+       snprintf(buf, strlen("/var/run/xenconsole-%d-%d") + 1, 
"/var/run/xenconsole-%d-%d", domid, num);
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This should be sizeof(buf).

Otherwise looks good to me.

Paolo

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.