Re: [patch 1/1] [ppc64-diag] hardening
Aruna Balakrishnaiah <[email protected]> Wed, 26 Mar 2014 15:22:57 +0530
| Newsgroups | gmane.linux.tools.diag.devel |
|---|---|
| Message-ID | <[email protected]> |
On Tuesday 25 March 2014 06:49 PM, [email protected] wrote: > hardening > ^^^ Please have a proper patch description here and in the header. > Signed-off-by: Fr=C3=A9d=C3=A9ric Bonnard<[email protected]> I see some special characters in your first name :) Rest looks good. Acked-by: Aruna Balakrishnaiah <[email protected]> > --- a/rtas_errd/epow.c > +++ b/rtas_errd/epow.c > @@ -109,7 +109,7 @@ > va_end(ap); > > log_msg(event, buf); > - snprintf(event->addl_text, ADDL_TEXT_MAX, buf); > + snprintf(event->addl_text, ADDL_TEXT_MAX, "%s", buf); > } > > /** > --- a/rtas_errd/dump.c > +++ b/rtas_errd/dump.c > @@ -161,7 +161,7 @@ > goto scanlog_error; > } > > - out =3D open(scanlog_filename, O_WRONLY | O_CREAT | O_TRUNC); > + out =3D open(scanlog_filename, O_WRONLY | O_CREAT | O_TRUNC, S_IRWXU); > if (out <=3D 0) { > log_msg(NULL, "Could not open %s for writing, %s", > scanlog_filename, strerror(errno)); > --- a/rtas_errd/files.c > +++ b/rtas_errd/files.c > @@ -671,7 +671,7 @@ > va_end(ap); > > len =3D reformat_msg(buf); > - fprintf(stdout, buf); > + fprintf(stdout, "%s", buf); > fflush(stdout); > } > > --- a/rtas_errd/config.c > +++ b/rtas_errd/config.c > @@ -79,7 +79,7 @@ > * started then skip ahead to the next line and > * return that point as the end of the search. > */ > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > = > while ((str < str_end) && (*str++ !=3D '\n')); > (*line_no)++; > @@ -97,7 +97,7 @@ > break; > } > > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > return str + 1; > break; > > @@ -112,7 +112,7 @@ > (*line_no)++; > str++; > } else { > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > } > > return str; > @@ -126,10 +126,10 @@ > * a token on their own. > */ > if (start =3D=3D NULL) { > - snprintf(tok, 2, str); > + snprintf(tok, 2, "%s", str); > str++; > } else { > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > } > > return str; > @@ -150,10 +150,10 @@ > else > str++; > } > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > str++; > } else { > - snprintf(tok, str - start + 1, start); > + snprintf(tok, str - start + 1, "%s", start); > } > > return str; > @@ -210,7 +210,7 @@ > if (start =3D=3D NULL) > return NULL; > > - offset +=3D sprintf(buf, tok); > + offset +=3D sprintf(buf, "%s", tok); > > start =3D get_token(start, end, tok, line_no); > while ((start !=3D NULL) && (tok[0] !=3D '\n')) { > --- a/rtas_errd/v6ela.c > +++ b/rtas_errd/v6ela.c > @@ -359,7 +359,7 @@ > offset +=3D sprintf(buffer + offset, msg, > asctime(date)); > else > - offset +=3D sprintf(buffer + offset, msg); > + offset +=3D sprintf(buffer + offset, "%s", msg); > } > > if (menu_num =3D=3D 0) { > --- a/rtas_errd/servicelog.c > +++ b/rtas_errd/servicelog.c > @@ -230,7 +230,7 @@ > } else { > event->sl_entry->description =3D (char *)malloc(txtlen+1); > snprintf(event->sl_entry->description, txtlen, > - event->addl_text); > + "%s", event->addl_text); > } > } > > --- a/diags/diag_encl.c > +++ b/diags/diag_encl.c > @@ -244,7 +244,7 @@ > > rc =3D servicelog_open(&slog, 0); > if (rc !=3D 0) { > - fprintf(stderr, servicelog_error(slog)); > + fprintf(stderr, "%s", servicelog_error(slog)); > return 0; > } > > @@ -253,7 +253,7 @@ > servicelog_close(slog); > > if (rc !=3D 0) { > - fprintf(stderr, servicelog_error(slog)); > + fprintf(stderr, "%s", servicelog_error(slog)); > return 0; > } > > > > > > -------------------------------------------------------------------------= ----- > Learn Graph Databases - Download FREE O'Reilly Book > "Graph Databases" is the definitive new guide to graph databases and their > applications. Written by three acclaimed leaders in the field, > this first edition is now available. Download your free book today! > http://p.sf.net/sfu/13534_NeoTech > > > > _______________________________________________ > Linux-diag-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/linux-diag-devel > ---------------------------------------------------------------------------= --- Learn Graph Databases - Download FREE O'Reilly Book "Graph Databases" is the definitive new guide to graph databases and their applications. Written by three acclaimed leaders in the field, this first edition is now available. Download your free book today! http://p.sf.net/sfu/13534_NeoTech