From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on sa.int.altlinux.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00 autolearn=unavailable version=3.2.5 Date: Fri, 24 Jul 2009 14:34:47 +0400 From: Sergey Vlasov To: devel@lists.altlinux.org Message-ID: <20090724103447.GA1759@newmaster.mivlgu.local> Mail-Followup-To: devel@lists.altlinux.org References: <4A692D09.9070400@mmedia2.kemsu.ru> <4A692FC4.70101@mmedia2.kemsu.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: <4A692FC4.70101@mmedia2.kemsu.ru> Subject: Re: [devel] PyGTK X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.12 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 24 Jul 2009 10:35:04 -0000 Archived-At: List-Archive: List-Post: --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Jul 24, 2009 at 11:51:32AM +0800, REAL wrote: > >https://bugzilla.altlinux.org/show_bug.cgi?id=3D20842 > 1021 In file included from /usr/include/string.h:658,=20 > 1022 from /usr/include/python2.6/Python.h:38,=20 > 1023 from gdk.c:4:=20 > 1024 In function 'strncpy',=20 > 1025 inlined from '_wrap_gdk_event_tp_setattr' at=20 > gdkevent.override:357: > 1026 /usr/include/bits/string3.h:122: error: call to=20 > __builtin___strncpy_chk will always overflow destination buffer=20 =FE=C1=D3=D4=D8 =D3=D4=D2=D5=CB=D4=D5=D2=D9, =D3 =CB=CF=D4=CF=D2=CF=CA =D0= =D2=CF=C9=DA=D7=CF=C4=D1=D4=D3=D1 =CF=D0=C5=D2=C1=C3=C9=C9, =D7=D9=C7=CC=D1= =C4=C9=D4 =D4=C1=CB: struct _GdkEventClient { GdkEventType type; GdkWindow *window; gint8 send_event; GdkAtom message_type; gushort data_format; union { char b[20]; short s[10]; long l[5]; } data; }; =ED=CF=D6=CE=CF =D3=CF=CB=D2=C1=D4=C9=D4=D8 testcase =C4=CF: #include struct Event { union { char b[4]; long l[1]; } data; }; void test_fn(struct Event *event, const char *tmp) { strncpy((char *) &event->data, tmp, sizeof(event->data)); } =F4.=C5., =CB=CF=D0=C9=D2=CF=D7=C1=CE=C9=C5 =D0=D2=CF=C9=DA=D7=CF=C4=C9=D4= =D3=D1 =D7 =D0=CF=CC=C5, =D1=D7=CC=D1=C0=DD=C5=C5=D3=D1 union, =CF=C4=C9=CE= =C9=DA =CB=CF=CD=D0=CF=CE=C5=CE=D4=CF=D7 =CB=CF=D4=CF=D2=CF=C7=CF - =CD=C1=D3=D3= =C9=D7 char. =F7 =DC=D4=CF=CD =D3=CC=D5=DE=C1=C5, =D0=CF=C8=CF=D6=C5, =D7 = =CB=C1=DE=C5=D3=D4=D7=C5 =D2=C1=DA=CD=C5=D2=C1 =CD=C1=D3=D3=C9=D7=C1 =C4=CC=D1 =D0=D2=CF=D7=C5=D2=CB= =C9 =CE=C1 =D0=C5=D2=C5=D0=CF=CC=CE=C5=CE=C9=C5 =C2=D5=C6=C5=D2=C1 =D7=D3= =C5=C7=C4=C1 =C2=C5=D2=A3=D4=D3=D1 =D2=C1=DA=CD=C5=D2 =CD=C1=D3=D3=C9=D7=C1 char, =CF=C4=CE=C1=CB=CF sizeof = =D7=CF=DA=D7=D2=C1=DD=C1=C5=D4 =D0=CF=CC=CE=D9=CA =D2=C1=DA=CD=C5=D2 =D7=D3= =C5=C7=CF union (=D3=CF=CF=D4=D7=C5=D4=D3=D4=D7=D5=C0=DD=C9=CA =CD=C1=CB=D3=C9=CD=C1= =CC=D8=CE=CF=CD=D5 =CB=CF=CD=D0=CF=CE=C5=CE=D4=D5 =D3 =D5=DE=A3=D4=CF=CD =D7=D9=D2=C1=D7=CE=C9=D7=C1=CE=C9=D1). =F7 =D2=C5=DA=D5=CC=D8=D4=C1=D4=C5 = =CB=CF=C4 =CE=CF=D2=CD=C1=CC=D8=CE=CF =CB=CF=CD=D0=C9=CC=C9=D2=D5=C5=D4=D3= =D1, =D0=CF=CB=C1 =C4=D2=D5=C7=C9=C5 =CB=CF=CD=D0=CF=CE=C5=CE=D4=D9 union =CE=C5 =D0=D2=C5=D7=CF=D3=C8=CF=C4=D1= =D4 =CD=C1=D3=D3=C9=D7 char =D0=CF =D2=C1=DA=CD=C5=D2=D5; =CF=C4=CE=C1=CB= =CF =CE=C1 x86_64 long =D3=D4=C1=CE=CF=D7=C9=D4=D3=D1 64-=C2=C9=D4=CE=D9=CD, =D7 =D2= =C5=DA=D5=CC=D8=D4=C1=D4=C5 =D2=C1=DA=CD=C5=D2 =D7=D3=C5=C7=CF union =D3=D4=C1=CE=CF=D7=C9=D4=D3=D1 =C2=CF=CC=D8=DB=C5, =DE=C5=CD =D2=C1=DA=CD= =C5=D2 =CD=C1=D3=D3=C9=D7=C1 b, =C9 =D0=D2=C9 =D0=CF=D0=D9=D4=CB=C5 =CB=CF= =D0=C9=D2=CF=D7=C1=CE=C9=D1 =D7 union =C6=C9=CB=D3=C9=D2=D5=C5=D4=D3=D1 =D0=C5=D2=C5=D0=CF=CC=CE=C5=CE=C9= =C5 =C2=D5=C6=C5=D2=C1 (=CE=C5=D3=CD=CF=D4=D2=D1 =CE=C1 =D4=CF, =DE=D4=CF =C9=D3=D0=CF=CC=D8=DA=D5=C5=D4=D3=D1 =C1=C4=D2=C5=D3 =D0=CF=CC=D1 data, =C1= =CE=C5 data.b). =ED=CF=D6=CE=CF =D0=CF=D0=D2=CF=C2=CF=D7=C1=D4=D8 =C9=D3=D0=D2=C1=D7=C9=D4= =D8 =CB=CF=C4 =D4=C1=CB: - strncpy((char *) &event->client.data, tmp, - sizeof(event->client.data)); + strncpy(event->client.data.b, tmp, + sizeof(event->client.data.b)); (=C4=C1=CE=CE=D9=C5 =D4=C9=D0=C1 short =C9=CC=C9 long =D7=D3=A3 =D2=C1=D7= =CE=CF =CE=C5=CC=D8=DA=D1 =C2=D5=C4=C5=D4 =D0=C5=D2=C5=C4=C1=D4=D8 =C9=DA-= =DA=C1 =CE=D5=CC=C5=D7=D9=C8 =C2=C1=CA=D4=CF=D7; =CE=D5=D6=C5=CE =CC=C9 =D4=C1=CD = '\0' =D7 =CB=CF=CE=C3=C5 - =DA=C1=D7=C9=D3=C9=D4 =CF=D4 =D4=CF=C7=CF, =C4= =CC=D1 =CB=CF=C7=CF =D0=D2=C5=C4=CE=C1=DA=CE=C1=DE=C1=C5=D4=D3=D1 =DC=D4=CF=D4 XClientMessageEv= ent; =D7 =CF=C2=DD=C5=CD =D3=CC=D5=DE=C1=C5 =D3=CF=C2=D9=D4=C9=C5 =C2=C5=DA =DA=C1=D7=C5=D2=DB=C1=C0=DD=C5=C7=CF '\0' =D7=D0=CF=CC=CE=C5 =CD=CF=D6=CE= =CF =D0=C5=D2=C5=C4=C1=D4=D8). =F0=D2=C1=D7=C4=C1, =D7 =C4=D2=D5=C7=CF=CD =CD=C5=D3=D4=C5 =C5=D3=D4=D8 =C5= =DD=A3 =CF=C2=D2=C1=D4=CE=CF=C5 =D0=D2=C5=CF=C2=D2=C1=DA=CF=D7=C1=CE=C9=C5: if (!strcmp(attr, "data")) return PyString_FromStringAndSize((char *) &event->client.data, sizeof(event->client.data)); =E4=CC=D1 =D3=CF=CF=D4=D7=C5=D4=D3=D4=D7=C9=D1 =C5=CD=D5 =CD=CF=D6=CE=CF = =D3=C4=C5=CC=C1=D4=D8 =D3=CF=D7=D3=C5=CD =D0=D2=C1=D7=C9=CC=D8=CE=CF: } else if (!strcmp(attr, "data")) { char *tmp; Py_ssize_t len; STRING_CHECK(); if (PyString_AsStringAndSize(value, &tmp, &len)) return -1; if (len < 0) return -1; if (len > sizeof(event->client.data)) len =3D sizeof(event->client.data); memcpy(&event->client.data, tmp, len); memset((char *)&event->client.data + len, 0, sizeof(event->client.data) - len); return 0; } (=F7 =DC=D4=CF=CD =D7=C1=D2=C9=C1=CE=D4=C5 =D7 =D3=D4=D2=CF=CB=C5 =CD=CF=C7= =D5=D4 =C2=D9=D4=D8 =C9 =CE=D5=CC=C5=D7=D9=C5 =C2=C1=CA=D4=D9, =CB=CF=D4=CF= =D2=D9=C5 =D0=CF=D0=C1=C4=D5=D4 =D7 =C2=D5=C6=C5=D2.) --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (GNU/Linux) iD8DBQFKaY5HW82GfkQfsqIRAnjtAJ9r73pKyA72t/FNW93AYA2GVdJMcQCfczrH nyDI7VDp0QMrTxaxGxZpVuY= =YbKe -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--