Signed-off-by: Jason Gerecke <[email protected]>
---
src/wcmConfig.c | 2 +-
src/wcmISDV4.c | 10 ++++++----
src/wcmUSB.c | 6 +++---
src/xf86WacomDefs.h | 2 +-
4 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/src/wcmConfig.c b/src/wcmConfig.c
index 138a769..c0cad90 100644
--- a/src/wcmConfig.c
+++ b/src/wcmConfig.c
@@ -455,7 +455,7 @@ wcmInitModel(InputInfoPtr pInfo)
float version;
/* Initialize the tablet */
- if(common->wcmDevCls->Init(pInfo, id, &version) != Success ||
+ if(common->wcmDevCls->Init(pInfo, id, ARRAY_SIZE(id), &version) !=
Success ||
wcmInitTablet(pInfo, id, version) != Success)
return FALSE;
diff --git a/src/wcmISDV4.c b/src/wcmISDV4.c
index a1a1fdd..4b4f854 100644
--- a/src/wcmISDV4.c
+++ b/src/wcmISDV4.c
@@ -70,7 +70,7 @@ typedef struct {
static Bool isdv4Detect(InputInfoPtr);
static Bool isdv4ParseOptions(InputInfoPtr pInfo);
-static Bool isdv4Init(InputInfoPtr, char* id, float *version);
+static Bool isdv4Init(InputInfoPtr, char* id, size_t id_len, float *version);
static int isdv4ProbeKeys(InputInfoPtr pInfo);
static void isdv4InitISDV4(WacomCommonPtr, const char* id, float version);
static int isdv4GetRanges(InputInfoPtr);
@@ -252,7 +252,7 @@ static Bool isdv4ParseOptions(InputInfoPtr pInfo)
* isdv4Init --
****************************************************************************/
-static Bool isdv4Init(InputInfoPtr pInfo, char* id, float *version)
+static Bool isdv4Init(InputInfoPtr pInfo, char* id, size_t id_len, float
*version)
{
WacomDevicePtr priv = (WacomDevicePtr)pInfo->private;
WacomCommonPtr common = priv->common;
@@ -264,8 +264,10 @@ static Bool isdv4Init(InputInfoPtr pInfo, char* id, float
*version)
if (xf86SetSerialSpeed(pInfo->fd, isdv4data->baudrate) < 0)
return !Success;
- if(id)
- strcpy(id, "ISDV4");
+ if(id) {
+ strncpy(id, "ISDV4", id_len);
+ id[id_len-1] = '\0';
+ }
if(version)
*version = common->wcmVersion;
diff --git a/src/wcmUSB.c b/src/wcmUSB.c
index 5332702..3d9a202 100644
--- a/src/wcmUSB.c
+++ b/src/wcmUSB.c
@@ -45,7 +45,7 @@ typedef struct {
} wcmUSBData;
static Bool usbDetect(InputInfoPtr);
-static Bool usbWcmInit(InputInfoPtr pDev, char* id, float *version);
+static Bool usbWcmInit(InputInfoPtr pDev, char* id, size_t id_len, float
*version);
static int usbProbeKeys(InputInfoPtr pInfo);
static int usbStart(InputInfoPtr pInfo);
static void usbInitProtocol5(WacomCommonPtr common, const char* id,
@@ -391,7 +391,7 @@ void usbListModels(void)
}
-static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float *version)
+static Bool usbWcmInit(InputInfoPtr pInfo, char* id, size_t id_len, float
*version)
{
int i;
struct input_id sID;
@@ -414,7 +414,7 @@ static Bool usbWcmInit(InputInfoPtr pInfo, char* id, float
*version)
/* fetch vendor, product, and model name */
ioctl(pInfo->fd, EVIOCGID, &sID);
- ioctl(pInfo->fd, EVIOCGNAME(sizeof(id)), id);
+ ioctl(pInfo->fd, EVIOCGNAME(id_len), id);
for (i = 0; i < ARRAY_SIZE(WacomModelDesc); i++)
{
diff --git a/src/xf86WacomDefs.h b/src/xf86WacomDefs.h
index 6db5a51..1575960 100644
--- a/src/xf86WacomDefs.h
+++ b/src/xf86WacomDefs.h
@@ -347,7 +347,7 @@ struct _WacomDeviceClass
{
Bool (*Detect)(InputInfoPtr pInfo); /* detect device */
Bool (*ParseOptions)(InputInfoPtr pInfo); /* parse class-specific
options */
- Bool (*Init)(InputInfoPtr pInfo, char* id, float *version); /*
initialize device */
+ Bool (*Init)(InputInfoPtr pInfo, char* id, size_t id_len, float
*version); /* initialize device */
int (*ProbeKeys)(InputInfoPtr pInfo); /* set the bits for the keys
supported */
};
--
2.1.0
------------------------------------------------------------------------------
Want excitement?
Manually upgrade your production database.
When you want reliability, choose Perforce
Perforce version control. Predictably reliable.
http://pubads.g.doubleclick.net/gampad/clk?id=157508191&iu=/4140/ostg.clktrk
_______________________________________________
Linuxwacom-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/linuxwacom-devel