Daniel Sahlberg <[email protected]> writes:

>    svn_boolean_t notify_required;
> +  svn_boolean_t notify_noaccess;
…
>    if (!metadata_only)
>      {
>        SVN_ERR(revert_wc_data(run_wq,
> -                             &notify_required,
> +                             &notify_required, &notify_noaccess,
>                               db, local_abspath, status, kind,
>                               reverted_kind, recorded_size, recorded_time,
>                               copied_here, use_commit_times,
…
> +  if (notify_func)
> +    {
> +      if (notify_required)
> +        notify_func(notify_baton,
> +                    svn_wc_create_notify(local_abspath, svn_wc_notify_revert,
> +                                         scratch_pool),
> +                    scratch_pool);
> +      else if (notify_noaccess)
> +        notify_func(notify_baton,
> +                    svn_wc_create_notify(local_abspath, 
> svn_wc_notify_revert_noaccess,
> +                                         scratch_pool),
> +                    scratch_pool);
> +    }

It looks like this may have introduced an undefined behavior for reverts with
metadata_only = TRUE.

If metadata_only is TRUE, the block calling revert_wc_data is skipped, meaning
notify_noaccess is never assigned a value.  However, the variable might still
be read later in the `else if (notify_noaccess)` check.


Thanks,
Evgeny Kotkov

Reply via email to