diff options
| author | Andreas Gampe <agampe@google.com> | 2014-12-05 19:06:40 -0800 |
|---|---|---|
| committer | Gerrit Code Review <gerrit@cyanogenmod.org> | 2015-11-19 01:48:13 -0800 |
| commit | 43c102052abb968fab8552e719b6c6879ef76119 (patch) | |
| tree | 0e783d863ab485b85a999fcdb50131d7f66d8373 | |
| parent | e1eed5dcee4421d8a68fc6dfcd0f58b15a1c5f8c (diff) | |
Conn_init: Fix unused variable
Bug: 18632512
Change-Id: I42e0169f762f30f7486170430eb1e472cfe620d8
| -rw-r--r-- | conn_init/conn_init.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/conn_init/conn_init.c b/conn_init/conn_init.c index 2cb5591..0aa5336 100644 --- a/conn_init/conn_init.c +++ b/conn_init/conn_init.c @@ -24,7 +24,7 @@ static int wifi_check_qcom_cfg_files() { char macAddress[13]; char hex[7]; - memset(macAddress, 0, 13); + memset(macAddress, 0, sizeof(macAddress)); memset(hex, 0, 7); // Read MAC String @@ -40,6 +40,10 @@ static int wifi_check_qcom_cfg_files() { n = fread(macAddress, 12, 1, fp); fclose(fp); + if (n == 0) { + // Buffer may be partially written. Reset. + memset(macAddress, 0, sizeof(macAddress)); + } // Write MAC String wfc_util_atoh( macAddress, 12, (unsigned char *)hex, 6); |
