From 08ea62d8fa0e9208257431a374c4aa74de421a6d Mon Sep 17 00:00:00 2001 From: "gergely.erdelyi" Date: Sun, 13 Sep 2009 17:36:05 +0000 Subject: [PATCH] kernwin.i: Copying strings with strcpy is baad. Thanks Elias for the patch! --- swig/kernwin.i | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/swig/kernwin.i b/swig/kernwin.i index d55b207..26e2acf 100644 --- a/swig/kernwin.i +++ b/swig/kernwin.i @@ -157,8 +157,6 @@ char * idaapi choose_getl(void *self, uint32 n, char *buf) PyObject *pyres; char *res; - char tmp[1024]; - pyres = PyObject_CallMethod((PyObject *)self, "getl", "l", n); if (!pyres) @@ -171,7 +169,7 @@ char * idaapi choose_getl(void *self, uint32 n, char *buf) if (res) { - strcpy(buf, res); + strncpy(buf, res, MAXSTR); res = buf; } else