projects
/
15.05
/
openwrt.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
0af4307
)
ar71xx: avoid possible NULL pointer dereference in ath79_init_{,local}_mac
author
Gabor Juhos
<juhosg@openwrt.org>
Thu, 27 Sep 2012 20:05:42 +0000
(20:05 +0000)
committer
Gabor Juhos
<juhosg@openwrt.org>
Thu, 27 Sep 2012 20:05:42 +0000
(20:05 +0000)
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@33575
3c298f89
-4303-0410-b956-
a3cf2f4a3e73
target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
patch
|
blob
|
history
diff --git
a/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
b/target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
index
d2d0ee8
..
4487958
100644
(file)
--- a/
target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
+++ b/
target/linux/ar71xx/files/arch/mips/ath79/dev-eth.c
@@
-992,7
+992,10
@@
void __init ath79_init_mac(unsigned char *dst, const unsigned char *src,
{
int t;
- if (!is_valid_ether_addr(src)) {
+ if (!dst)
+ return;
+
+ if (!src || !is_valid_ether_addr(src)) {
memset(dst, '\0', ETH_ALEN);
return;
}
@@
-1012,7
+1015,10
@@
void __init ath79_init_local_mac(unsigned char *dst, const unsigned char *src)
{
int i;
- if (!is_valid_ether_addr(src)) {
+ if (!dst)
+ return;
+
+ if (!src || !is_valid_ether_addr(src)) {
memset(dst, '\0', ETH_ALEN);
return;
}