From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LRbuD-0007rm-0p for qemu-devel@nongnu.org; Mon, 26 Jan 2009 19:34:17 -0500 Received: from [199.232.76.173] (port=46794 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LRbuC-0007rV-Fo for qemu-devel@nongnu.org; Mon, 26 Jan 2009 19:34:16 -0500 Received: from imp01.mtu.ru ([62.5.255.10]:49716) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1LRbuB-0006Ts-TE for qemu-devel@nongnu.org; Mon, 26 Jan 2009 19:34:16 -0500 Received: from ss27-so02.mtu.ru (localhost [127.0.0.1]) by ss27-so02.mtu.ru (Postfix) with ESMTP id 581E7229B01 for ; Tue, 27 Jan 2009 03:34:14 +0300 (MSK) Received: from imp01.mtu.ru (alt-proxy-1.mtu.ru [62.5.255.74]) by ss27-so02.mtu.ru (Postfix) with ESMTP id 4A944229A51 for ; Tue, 27 Jan 2009 03:34:14 +0300 (MSK) From: Pavel Vasilyev Date: Tue, 27 Jan 2009 03:34:05 +0300 References: <200901270313.26331.pavel@pavlinux.ru> In-Reply-To: <200901270313.26331.pavel@pavlinux.ru> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart12854832.LqjSPhvAt4"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200901270334.14108.pavel@pavlinux.ru> Subject: [Qemu-devel] [PATCH] Replace strcmp() by strncmp() Reply-To: pavel@pavlinux.ru, qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org --nextPart12854832.LqjSPhvAt4 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Possible SIGSEGV=20 Index: net.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D =2D-- net.c (revision 6463) +++ net.c (working copy) @@ -1568,7 +1586,7 @@ if (get_param_value(buf, sizeof(buf), "name", p)) { name =3D strdup(buf); } =2D if (!strcmp(device, "nic")) { + if (!strncmp(device, "nic", 3)) { NICInfo *nd; uint8_t *macaddr; @@ -1601,13 +1630,13 @@ vlan->nb_guest_devs++; ret =3D 0; } else =2D if (!strcmp(device, "none")) { + if (!strncmp(device, "none", 4)) { /* does nothing. It is needed to signal that no network cards are wanted */ ret =3D 0; } else #ifdef CONFIG_SLIRP =2D if (!strcmp(device, "user")) { + if (!strncmp(device, "user", 4)) { if (get_param_value(buf, sizeof(buf), "hostname", p)) { pstrcpy(slirp_hostname, sizeof(slirp_hostname), buf); } @@ -1622,7 +1651,7 @@ } else #endif #ifdef _WIN32 =2D if (!strcmp(device, "tap")) { + if (!strncmp(device, "tap", 3)) { char ifname[64]; if (get_param_value(ifname, sizeof(ifname), "ifname", p) <=3D 0) { fprintf(stderr, "tap: no interface name\n"); @@ -1633,7 +1662,7 @@ } else #elif defined (_AIX) #else =2D if (!strcmp(device, "tap")) { + if (!strncmp(device, "tap", 3)) { char ifname[64]; char setup_script[1024], down_script[1024]; int fd; --nextPart12854832.LqjSPhvAt4 Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.4-svn0 (GNU/Linux) iD8DBQBJflaGMFsE+gWr1VkRAkFTAJ9V8Q0Q25ps/F60R/8vFLAzfmbxlQCfZJEB zOOhU83hMMR4SZd0d1FKolc= =SjRA -----END PGP SIGNATURE----- --nextPart12854832.LqjSPhvAt4--