~ubuntu-branches/ubuntu/trusty/mariadb-5.5/trusty-proposed

« back to all changes in this revision

Viewing changes to storage/tokudb/ft-index/third_party/xz-4.999.9beta/src/liblzma/common/filter_flags_encoder.c

  • Committer: Package Import Robot
  • Author(s): James Page, Otto Kekäläinen
  • Date: 2014-02-17 16:51:52 UTC
  • mfrom: (2.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20140217165152-k315d3175g865kkx
Tags: 5.5.35-1
[ Otto Kekäläinen ]
* New upstream release, fixing the following security issues:
  - Buffer overflow in client/mysql.cc (Closes: #737597).
    - CVE-2014-0001
  - http://www.oracle.com/technetwork/topics/security/cpujan2014-1972949.html
    - CVE-2013-5891
    - CVE-2013-5908
    - CVE-2014-0386
    - CVE-2014-0393
    - CVE-2014-0401
    - CVE-2014-0402
    - CVE-2014-0412
    - CVE-2014-0420
    - CVE-2014-0437
* Upstream https://mariadb.atlassian.net/browse/MDEV-4902
  fixes compatibility with Bison 3.0 (Closes: #733002)
* Updated Russian debconf translation (Closes: #734426)
* Updated Japanese debconf translation (Closes: #735284)
* Updated French debconf translation (Closes: #736480)
* Renamed SONAME properly (Closes: #732967)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */
 
2
// vim: expandtab:ts=8:sw=4:softtabstop=4:
 
3
///////////////////////////////////////////////////////////////////////////////
 
4
//
 
5
/// \file       filter_flags_encoder.c
 
6
/// \brief      Decodes a Filter Flags field
 
7
//
 
8
//  Author:     Lasse Collin
 
9
//
 
10
//  This file has been put into the public domain.
 
11
//  You can do whatever you want with this file.
 
12
//
 
13
///////////////////////////////////////////////////////////////////////////////
 
14
 
 
15
#include "filter_encoder.h"
 
16
 
 
17
 
 
18
extern LZMA_API(lzma_ret)
 
19
lzma_filter_flags_size(uint32_t *size, const lzma_filter *filter)
 
20
{
 
21
        if (filter->id >= LZMA_FILTER_RESERVED_START)
 
22
                return LZMA_PROG_ERROR;
 
23
 
 
24
        return_if_error(lzma_properties_size(size, filter));
 
25
 
 
26
        *size += lzma_vli_size(filter->id) + lzma_vli_size(*size);
 
27
 
 
28
        return LZMA_OK;
 
29
}
 
30
 
 
31
 
 
32
extern LZMA_API(lzma_ret)
 
33
lzma_filter_flags_encode(const lzma_filter *filter,
 
34
                uint8_t *out, size_t *out_pos, size_t out_size)
 
35
{
 
36
        // Filter ID
 
37
        if (filter->id >= LZMA_FILTER_RESERVED_START)
 
38
                return LZMA_PROG_ERROR;
 
39
 
 
40
        return_if_error(lzma_vli_encode(filter->id, NULL,
 
41
                        out, out_pos, out_size));
 
42
 
 
43
        // Size of Properties
 
44
        uint32_t props_size;
 
45
        return_if_error(lzma_properties_size(&props_size, filter));
 
46
        return_if_error(lzma_vli_encode(props_size, NULL,
 
47
                        out, out_pos, out_size));
 
48
 
 
49
        // Filter Properties
 
50
        if (out_size - *out_pos < props_size)
 
51
                return LZMA_PROG_ERROR;
 
52
 
 
53
        return_if_error(lzma_properties_encode(filter, out + *out_pos));
 
54
 
 
55
        *out_pos += props_size;
 
56
 
 
57
        return LZMA_OK;
 
58
}