projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
335553c
)
thermal: use strlcpy instead of strcpy
author
Eduardo Valentin
<
[email protected]
>
Tue, 23 Apr 2013 21:48:12 +0000
(21:48 +0000)
committer
Zhang Rui
<
[email protected]
>
Wed, 24 Apr 2013 16:56:07 +0000
(
00:56
+0800)
For memory boundaries safety, use strlcpy instead of strcpy.
Signed-off-by: Eduardo Valentin <
[email protected]
>
Signed-off-by: Zhang Rui <
[email protected]
>
drivers/thermal/thermal_core.c
patch
|
blob
|
history
diff --git
a/drivers/thermal/thermal_core.c
b/drivers/thermal/thermal_core.c
index c0779adb24599006e13229fa32dfde56fad22e98..768ad312ba29f497cfc651a35cec4f33e15cbc0c 100644
(file)
--- a/
drivers/thermal/thermal_core.c
+++ b/
drivers/thermal/thermal_core.c
@@
-1301,7
+1301,7
@@
thermal_cooling_device_register(char *type, void *devdata,
return ERR_PTR(result);
}
- str
cpy(cdev->type, type ? : ""
);
+ str
lcpy(cdev->type, type ? : "", sizeof(cdev->type)
);
mutex_init(&cdev->lock);
INIT_LIST_HEAD(&cdev->thermal_instances);
cdev->ops = ops;
@@
-1606,7
+1606,7
@@
struct thermal_zone_device *thermal_zone_device_register(const char *type,
return ERR_PTR(result);
}
- str
cpy(tz->type, type ? : ""
);
+ str
lcpy(tz->type, type ? : "", sizeof(tz->type)
);
tz->ops = ops;
tz->tzp = tzp;
tz->device.class = &thermal_class;