1. 11 7月, 2017 32 次提交
  2. 08 7月, 2017 3 次提交
    • B
      unicode: update the width tables to Unicode 10 · 7560aacd
      Beat Bolli 提交于
      Now that Unicode 10 has been announced[0], update the character
      width tables to the new version.
      
      [0] http://blog.unicode.org/2017/06/announcing-unicode-standard-version-100.htmlSigned-off-by: NBeat Bolli <dev+git@drbeat.li>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      7560aacd
    • J
      reflog-walk: include all fields when freeing complete_reflogs · e30d463d
      Jeff King 提交于
      When we encounter an error adding reflogs for a walk, we try
      to free any logs we have read. But we didn't free all
      fields, meaning that we could in theory leak all of the
      "items" array (which would consitute the bulk of the
      allocated memory).
      
      This patch adds a helper which frees all of the entries and
      uses it as appropriate.
      
      As it turns out, the leak seems impossible to trigger with
      the current code. Of the three error paths that free the
      complete_reflogs struct, two only kick in when the items
      array is empty, and the third was removed entirely in the
      previous commit.
      
      So this patch should be a noop in terms of behavior, but it
      fixes a potential maintenance headache should anybody add a
      new error path and copy the partial-free code. Which is
      what happened in 5026b471 (add_reflog_for_walk: avoid
      memory leak, 2017-05-04), though its leaky call was the
      third one that was recently removed.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      e30d463d
    • J
      reflog-walk: don't free reflogs added to cache · 8aae3cf7
      Jeff King 提交于
      The add_reflog_for_walk() function keeps a cache mapping
      refnames to their reflog contents. We use a cached reflog
      entry if available, and otherwise allocate and store a new
      one.
      
      Since 5026b471 (add_reflog_for_walk: avoid memory leak,
      2017-05-04), when we hit an error parsing a date-based
      reflog spec, we free the reflog memory but leave the cache
      entry pointing to the now-freed memory.
      
      We can fix this by just leaving the memory intact once it
      has made it into the cache. This may leave an unused entry
      in the cache, but that's OK. And it means we also catch a
      similar situation: we may not have allocated at all in this
      invocation, but simply be pointing to a cached entry from a
      previous invocation (which is relying on that entry being
      present).
      
      The new test in t1411 exercises this case and fails when run
      with --valgrind or ASan.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8aae3cf7
  3. 07 7月, 2017 5 次提交
    • J
      reflog-walk: duplicate strings in complete_reflogs list · 75afe7ac
      Jeff King 提交于
      As part of the add_reflog_to_walk() function, we keep a
      string_list mapping refnames to their reflog contents. This
      serves as a cache so that accessing the same reflog twice
      requires only a single copy of the log in memory.
      
      The string_list is initialized via xcalloc, meaning its
      strdup_strings field is set to 0. But after inserting a
      string into the list, we unconditionally call free() on the
      string, leaving the list pointing to freed memory. If
      another reflog is added (e.g., "git log -g HEAD HEAD"), then
      the second one may have unpredictable results.
      
      The extra free was added by 5026b471 (add_reflog_for_walk:
      avoid memory leak, 2017-05-04). Though if you look
      carefully, you can see that the code was buggy even before
      then. If we tried to read the reflogs by time but came up
      with no entries, we exited with an error, freeing the string
      in that code path. So the bug was harder to trigger, but
      still there.
      
      We can fix it by just asking the string list to make a copy
      of the string. Technically we could fix the problem by not
      calling free() on our string (and just handing over
      ownership to the string list), but there are enough
      conditionals that it's quite hard to figure out which code
      paths need the free and which do not. Simpler is better
      here.
      
      The new test reliably shows the problem when run with
      --valgrind or ASAN.
      Signed-off-by: NJeff King <peff@peff.net>
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      75afe7ac
    • J
      Fifteenth batch for 2.14 · 8b2efe2a
      Junio C Hamano 提交于
      Signed-off-by: NJunio C Hamano <gitster@pobox.com>
      8b2efe2a
    • J
      Merge branch 'ab/strbuf-addftime-tzname-boolify' · 6ba649e4
      Junio C Hamano 提交于
      strbuf_addftime() is further getting tweaked.
      
      * ab/strbuf-addftime-tzname-boolify:
        strbuf: change an always NULL/"" strbuf_addftime() param to bool
        strbuf.h comment: discuss strbuf_addftime() arguments in order
      6ba649e4
    • J
      Merge branch 'xz/send-email-batch-size' · eb37527a
      Junio C Hamano 提交于
      "git send-email" learned to overcome some SMTP server limitation
      that does not allow many pieces of e-mails to be sent over a single
      session.
      
      * xz/send-email-batch-size:
        send-email: --batch-size to work around some SMTP server limit
      eb37527a
    • J
      Merge branch 'js/t5534-rev-parse-gives-multi-line-output-fix' · ccce1e51
      Junio C Hamano 提交于
      A few tests that tried to verify the contents of push certificates
      did not use 'git rev-parse' to formulate the line to look for in
      the certificate correctly.
      
      * js/t5534-rev-parse-gives-multi-line-output-fix:
        t5534: fix misleading grep invocation
      ccce1e51