-
npes87184 authored
The &cmd will return a pointer which point to a pointer of cmdline. It is a memory address which is usually 8 bytes in 64 bits machine. However, the struct cmdline is 4 bytes. This will cause setting zero beyond the bound. Below is a simple example to show the differentiation: struct cmdline { char skip_initramfs; char slot[3]; }; static void parse_cmdline(struct cmdline *cmd) { printf("%lu\n", sizeof(*cmd)); /* 4 */ printf("%lu\n", sizeof(&cmd)); /* 8 */ } int main() { struct cmdline cmd; parse_cmdline(&cmd); return 0; } This patch prevents this. Signed-off-by:
npes87184 <npes87184@gmail.com>
312466aa
Name |
Last commit
|
Last update |
---|---|---|
app @ 4ff39f88 | ||
chromeos | ||
docs | ||
gradle/wrapper | ||
native | ||
scripts | ||
snet | ||
utils | ||
.gitattributes | ||
.gitignore | ||
.gitmodules | ||
LICENSE | ||
README.MD | ||
build.gradle | ||
build.py | ||
config.prop.sample | ||
gradle.properties | ||
gradlew | ||
gradlew.bat | ||
settings.gradle |