* [PATCH] modpost: check strdup() return value
@ 2018-08-14 20:50 Randy Dunlap
2018-08-15 3:40 ` Masahiro Yamada
0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2018-08-14 20:50 UTC (permalink / raw)
To: linux-kbuild, LKML; +Cc: Yuexing Wang, Masahiro Yamada
From: Randy Dunlap <rdunlap@infradead.org>
Fix missing error check for function strdup() in scripts/mod/modpost.c.
Fixes kernel bugzilla #200319:
https://bugzilla.kernel.org/show_bug.cgi?id=200319
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Yuexing Wang <wangyxlandq@gmail.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
---
scripts/mod/modpost.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
--- linux-next-20180814.orig/scripts/mod/modpost.c
+++ linux-next-20180814/scripts/mod/modpost.c
@@ -672,7 +672,7 @@ static void handle_modversions(struct mo
if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
break;
if (symname[0] == '.') {
- char *munged = strdup(symname);
+ char *munged = NOFAIL(strdup(symname));
munged[0] = '_';
munged[1] = toupper(munged[1]);
symname = munged;
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] modpost: check strdup() return value
2018-08-14 20:50 [PATCH] modpost: check strdup() return value Randy Dunlap
@ 2018-08-15 3:40 ` Masahiro Yamada
0 siblings, 0 replies; 2+ messages in thread
From: Masahiro Yamada @ 2018-08-15 3:40 UTC (permalink / raw)
To: Randy Dunlap; +Cc: linux-kbuild, LKML, Yuexing Wang
2018-08-15 5:50 GMT+09:00 Randy Dunlap <rdunlap@infradead.org>:
> From: Randy Dunlap <rdunlap@infradead.org>
>
> Fix missing error check for function strdup() in scripts/mod/modpost.c.
>
> Fixes kernel bugzilla #200319:
> https://bugzilla.kernel.org/show_bug.cgi?id=200319
>
> Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
> Cc: Yuexing Wang <wangyxlandq@gmail.com>
> Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
> ---
> scripts/mod/modpost.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> --- linux-next-20180814.orig/scripts/mod/modpost.c
> +++ linux-next-20180814/scripts/mod/modpost.c
> @@ -672,7 +672,7 @@ static void handle_modversions(struct mo
> if (ELF_ST_TYPE(sym->st_info) == STT_SPARC_REGISTER)
> break;
> if (symname[0] == '.') {
> - char *munged = strdup(symname);
> + char *munged = NOFAIL(strdup(symname));
> munged[0] = '_';
> munged[1] = toupper(munged[1]);
> symname = munged;
>
>
While you are here,
will you fix a little more?
line 1321:
char *p = malloc(20);
line 1341:
return strdup("");
line 2039:
buf->p = realloc(buf->p, buf->size);
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-08-15 3:41 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-14 20:50 [PATCH] modpost: check strdup() return value Randy Dunlap
2018-08-15 3:40 ` Masahiro Yamada
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.