[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Fixing some warnings in emacs-26

From: Eli Zaretskii
Subject: Re: Fixing some warnings in emacs-26
Date: Sat, 08 Jun 2019 09:41:33 +0300

> From: Juanma Barranquero <address@hidden>
> Date: Sat, 8 Jun 2019 07:11:01 +0200
> I'd like to propose these two patches for the emacs-26 release branch.


> The first one fixes a real (if perhaps unlikely) buffer overflow in addpm.c.

Thanks for catching that, see a comment below.

> The second one just adds a couple of defvars and marks some unused
> args with _underscore to silence a few lexical warnings.

LGTM, thanks.  However, please install those on master, as I'd like to
minimize changes on the release branch: we will start the pretest of
Emacs 26.3 soon.

In general, cleanups that have no real bearing on the code should be
installed on master.

> --- a/nt/addpm.c
> +++ b/nt/addpm.c
> @@ -219,7 +219,7 @@ main (int argc, char *argv[])
>   {
>     int result;
> -   char msg[ MAX_PATH ];
> +   char msg[ MAX_PATH + 20 ]; /* Needs extra space for fixed text.  */
>     sprintf (msg, "Install Emacs at %s?\n", emacs_path);

Instead of the arbitrary value of 20, I'd prefer using sizeof for the
actual text (which should probably be assigned to a variable, to avoid
mentioning the same text twice).

reply via email to

[Prev in Thread] Current Thread [Next in Thread]