anchor.diff:        // Skip over the equals sign
         offset = nextEquals + 1;
   
  -      // Subtract one for trailing newline
  +      // Subtract one for trailing newline for value
         final endOfValue = endOfEntry - 1;
  -      final value = utf8.decoder.convert(data, offset, endOfValue);
  -
  -      if (!_isValidPaxRecord(key, value)) {
  +
  +      if (!_isValidPaxKey(key)) {
           error();
         }
   
         // If we're seeing weird PAX Version 0.0 sparse keys, expect alternating
         // GNU.sparse.offset and GNU.sparse.numbytes headers.
         if (key == paxGNUSparseNumBytes || key == paxGNUSparseOffset) {
  -        if ((sparseMap.length.isEven && key != paxGNUSparseOffset) ||
  +        final value = utf8.decoder.convert(data, offset, endOfValue);
  +
  +        if (!_isValidPaxRecord(key, value) ||
  +            (sparseMap.length.isEven && key != paxGNUSparseOffset) ||
               (sparseMap.length.isOdd && key != paxGNUSparseNumBytes) ||
               value.contains(',')) {
             error();
  
positive.code:       } else if (!ignoreUnknown || supportedPaxHeaders.contains(key)) {
          // Ignore unrecognized headers to avoid unbounded growth of the global
          // header map.
          map[key] = value;
        }
  
  
negative.code:     }
    }
  
    // NB: Some Tar files have malformed UTF-8 data in the headers, we should
    // decode them anyways even if they're broken
    static const unsafeUtf8Decoder = Utf8Decoder(allowMalformed: true);
  
    static bool _isValidPaxKey(String key) {
      // These limitations are documented in the PAX standard.
      return key.isNotEmpty && !key.contains('=') & !key.codeUnits.contains(0);
    }
  
    /// Checks whether [key], [value] is a valid entry in a pax header.
    ///
    /// This is adopted from the Golang tar reader (`validPAXRecord`), which says
    /// that "Keys and values should be UTF-8, but the number of bad writers out
    /// there forces us to be a more liberal."
    static bool _isValidPaxRecord(String key, String value) {
      // These aren't documented in any standard, but Golangs's tar has them and
      // got away with it.
      switch (key) {
        case paxPath:
        case paxLinkpath:
  