[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: [PATCH] Perl bindings corrupt "{DATE}" revision variable

From: Roderich Schupp <roderich.schupp_at_gmail.com>
Date: Thu, 3 Nov 2016 18:36:20 +0100

On Thu, Nov 3, 2016 at 10:27 AM, Bert Huijben <bert_at_qqmail.nl> wrote:

> I’m not sure about the perl rules applied around this function, but
> perhaps we should just copy the string instead of changing memory that we
> receive as constant. We might also have a different api function that
> behaves in a cleaner way.

Well, the code to parse a "{DATE}" looks like it was lifted from
subversion/libsvn_subr/opt.c :)
Of course, it would be cleaner to copy the substring between the braces,
but that would involve allocating some memory, either the SVN way (using
the passed-in pool) or the Perl way (which needs to get the lifetime, ie.
ref count, right). For bonus credit, we could do it with a Perl regex
(using the perlguts C API for the extra thrill). But I think the approach
of temporarily substituting a NUL byte is OK, no Perl code (callbacks) can
run during this timespan, so it should be safe.

Cheers, Roderich
Received on 2016-11-03 18:36:27 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.