Re: Possibly missing pointer dereference in parse-diff.c

2023-01-09 Thread Nathan Hartman
On Mon, Jan 9, 2023 at 9:06 AM Stefan Sperling  wrote:

> Thank you Johannes, this has been committed. Your fix is indeed correct.


Also nominated for backport to 1.14.x.

Thanks!
Nathan


Re: Possibly missing pointer dereference in parse-diff.c

2023-01-09 Thread Stefan Sperling
On Mon, Jan 09, 2023 at 11:19:48AM +0100, Johannes von Rotz wrote:
> Hello
> 
> I was trying to compile subversion with the HP ANSI C compiler on HP-UX
> yesterday, which complained about the if-statement in question requiring a
> scalar value or something. Unfortunately, I'm unable to recite the specific
> error message, since I'm currently at work (Ahem...)
> 
> It seems to me that there is a missing pointer dereference in that
> if-statement, but i might be wrong about that. Feel free to ignore this...
> 
> Cheers, J.

Thank you Johannes, this has been committed. Your fix is indeed correct.

> Index: subversion/libsvn_diff/parse-diff.c
> ===
> --- subversion/libsvn_diff/parse-diff.c   (revision 1906480)
> +++ subversion/libsvn_diff/parse-diff.c   (working copy)
> @@ -1006,7 +1006,7 @@ parse_pretty_mergeinfo_line(svn_boolean_t *found_m
>  }
>(*number_of_reverse_merges)--;
>  }
> -  else if (number_of_forward_merges > 0) /* forward merges */
> +  else if (*number_of_forward_merges > 0) /* forward merges */
>  {
>if (patch->reverse)
>  {



Re: Possibly missing pointer dereference in parse-diff.c

2023-01-09 Thread Johannes von Rotz

Daniel Sahlberg wrote:
One question to Johannes, we have a system of crediting the original 
author in the log message, see [1]. Do you want to use your full 
name/e-mail or any masking?

Hi Daniel

Feel free to use my full name and e-mail if the patch is relevant.

Cheers, J.


Re: Possibly missing pointer dereference in parse-diff.c

2023-01-09 Thread Daniel Sahlberg
Den mån 9 jan. 2023 kl 11:20 skrev Johannes von Rotz :

> Hello
>
> I was trying to compile subversion with the HP ANSI C compiler on HP-UX
> yesterday, which complained about the if-statement in question requiring
> a scalar value or something. Unfortunately, I'm unable to recite the
> specific error message, since I'm currently at work (Ahem...)
>
> It seems to me that there is a missing pointer dereference in that
> if-statement, but i might be wrong about that. Feel free to ignore this...
>

Hi,

Thanks for the patch! On a cursory glance, this seems like a good catch!

The line in question was added in r1823026 on the "better-prisintes" branch
(according to the log message). I'd like to dig a little but further into
the history to understand if there is something I'm missing, but I'm a bit
short of time this week. If someone else beats me to it, please feel free!

One question to Johannes, we have a system of crediting the original author
in the log message, see [1]. Do you want to use your full name/e-mail or
any masking?

Kind regards,
Daniel Sahlberg

[1]
https://subversion.apache.org/docs/community-guide/conventions.html#crediting


Possibly missing pointer dereference in parse-diff.c

2023-01-09 Thread Johannes von Rotz

Hello

I was trying to compile subversion with the HP ANSI C compiler on HP-UX 
yesterday, which complained about the if-statement in question requiring 
a scalar value or something. Unfortunately, I'm unable to recite the 
specific error message, since I'm currently at work (Ahem...)


It seems to me that there is a missing pointer dereference in that 
if-statement, but i might be wrong about that. Feel free to ignore this...


Cheers, J.
Index: subversion/libsvn_diff/parse-diff.c
===
--- subversion/libsvn_diff/parse-diff.c	(revision 1906480)
+++ subversion/libsvn_diff/parse-diff.c	(working copy)
@@ -1006,7 +1006,7 @@ parse_pretty_mergeinfo_line(svn_boolean_t *found_m
 }
   (*number_of_reverse_merges)--;
 }
-  else if (number_of_forward_merges > 0) /* forward merges */
+  else if (*number_of_forward_merges > 0) /* forward merges */
 {
   if (patch->reverse)
 {