commit | 11fd9ec1ab8dfa7ae45c6edeea48dddc4633efea | [log] [tgz] |
---|---|---|
author | Matt Wala <wala@google.com> | Fri Jul 10 16:40:12 2015 -0700 |
committer | Matt Wala <wala@google.com> | Fri Jul 10 16:40:12 2015 -0700 |
tree | e4220a62bcabfad430e6bfc76f8bb2f324fcb409 | |
parent | 5bf7ace8e25ca0c93822492c9ad7caed70a7c594 [diff] |
CPU ref: Fix potential buffer over-read / uninitialized memory access. GetCpuInfo() was reading /proc/cpuinfo into a string without properly null terminating the result. The resulting unterminated string was being passed to strstr(). Change the code to read the file with fgets(), which ensures the result is null terminated. Also, document the GetCpuInfo() function and the global variable that it sets. Change-Id: I041331fdc25d79217ff7c1bf36a4aff2be8e0192