Fix ages old segfault on trying to expand %{lua} (RhBug:972646)
authorPanu Matilainen <pmatilai@redhat.com>
Tue, 11 Jun 2013 08:17:21 +0000 (11:17 +0300)
committerPanu Matilainen <pmatilai@redhat.com>
Tue, 11 Jun 2013 08:38:03 +0000 (11:38 +0300)
commit0cbd77c205b0d7fcc69d7d923e407464867fceb5
treed8ba26d8528d2566f84b64678f9459acc7d58369
parent00e1e09fd3e395d200ce5308bbb36b66b98bbda9
Fix ages old segfault on trying to expand %{lua} (RhBug:972646)

- Using the already calculated macro arg + arglen for copying the
  buffer instead of buggy local variant helps... This is as old as
  the embedded lua interpreter in rpm, close to a decade.
- Besides fixing the segfault, this actually makes it behave like
  other built-ins, evaluating to empty string when an empty arguments
  or no arguments are passed.
(cherry picked from commit ae5795897159319923b60f5c141a2ae5aa6f8d68)
rpmio/macro.c