]> granicus.if.org Git - esp-idf/commitdiff
efuse: Fix excess data coming from uninitialized variable
authorGOPTIONS\pfrost <peter.frost@geotogether.com>
Mon, 15 Apr 2019 10:31:01 +0000 (11:31 +0100)
committerbot <bot@espressif.com>
Mon, 15 Apr 2019 12:32:26 +0000 (12:32 +0000)
Fixed esp_efuse_get_pkg_ver() function

Closes: https://github.com/espressif/esp-idf/pull/3309
Closes: IDFGH-976
components/efuse/src/esp_efuse_fields.c

index 097fe8445e08bba4de519ea914e52ec6d976b8dd..bee02641f13bd374fb18204a3613a80aca69071e 100644 (file)
@@ -39,7 +39,7 @@ uint8_t esp_efuse_get_chip_ver(void)
 // Returns chip package from efuse
 uint32_t esp_efuse_get_pkg_ver(void)
 {
-    uint32_t pkg_ver;
+    uint32_t pkg_ver = 0;
     esp_efuse_read_field_blob(ESP_EFUSE_CHIP_VER_PKG, &pkg_ver, 3);
     return pkg_ver;
 }