Changeset 988 for vendor/current/lib/tdr


Ignore:
Timestamp:
Nov 24, 2016, 1:14:11 PM (9 years ago)
Author:
Silvan Scherrer
Message:

Samba Server: update vendor to version 4.4.3

Location:
vendor/current/lib/tdr
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • vendor/current/lib/tdr/tdr.c

    r740 r988  
    1 /* 
     1/*
    22   Unix SMB/CIFS implementation.
    33
     
    66
    77   Copyright (C) Jelmer Vernooij 2005
    8    
     8
    99   This program is free software; you can redistribute it and/or modify
    1010   it under the terms of the GNU General Public License as published by
    1111   the Free Software Foundation; either version 3 of the License, or
    1212   (at your option) any later version.
    13    
     13
    1414   This program is distributed in the hope that it will be useful,
    1515   but WITHOUT ANY WARRANTY; without even the implied warranty of
    1616   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    1717   GNU General Public License for more details.
    18    
     18
    1919   You should have received a copy of the GNU General Public License
    2020   along with this program.  If not, see <http://www.gnu.org/licenses/>.
     
    163163
    164164        TDR_PULL_NEED_BYTES(tdr, el_size*length);
    165        
    166         if (!convert_string_talloc(ctx, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret, false)) {
     165
     166        if (!convert_string_talloc(ctx, chset, CH_UNIX, tdr->data.data+tdr->offset, el_size*length, discard_const_p(void *, v), &ret)) {
    167167                return NT_STATUS_INVALID_PARAMETER;
    168168        }
     
    175175NTSTATUS tdr_push_charset(struct tdr_push *tdr, const char **v, uint32_t length, uint32_t el_size, charset_t chset)
    176176{
    177         size_t ret, required;
     177        size_t required, size = 0;
     178        bool ret;
    178179
    179180        if (length == -1) {
     
    184185        TDR_PUSH_NEED_BYTES(tdr, required);
    185186
    186         ret = convert_string(CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required, false);
    187         if (ret == -1) {
     187        ret = convert_string(CH_UNIX, chset, *v, strlen(*v), tdr->data.data+tdr->data.length, required, &size);
     188        if (ret == false) {
    188189                return NT_STATUS_INVALID_PARAMETER;
    189190        }
    190191
    191192        /* Make sure the remaining part of the string is filled with zeroes */
    192         if (ret < required) {
    193                 memset(tdr->data.data+tdr->data.length+ret, 0, required-ret);
    194         }
    195        
     193        if (size < required) {
     194                memset(tdr->data.data+tdr->data.length+size, 0, required-size);
     195        }
     196
    196197        tdr->data.length += required;
    197                                                  
     198
    198199        return NT_STATUS_OK;
    199200}
     
    297298
    298299/*
    299   push a DATA_BLOB onto the wire. 
     300  push a DATA_BLOB onto the wire.
    300301*/
    301302NTSTATUS tdr_push_DATA_BLOB(struct tdr_push *tdr, DATA_BLOB *blob)
     
    310311
    311312        TDR_PUSH_NEED_BYTES(tdr, blob->length);
    312        
     313
    313314        memcpy(tdr->data.data+tdr->data.length, blob->data, blob->length);
    314315        return NT_STATUS_OK;
     
    316317
    317318/*
    318   pull a DATA_BLOB from the wire. 
     319  pull a DATA_BLOB from the wire.
    319320*/
    320321NTSTATUS tdr_pull_DATA_BLOB(struct tdr_pull *tdr, TALLOC_CTX *ctx, DATA_BLOB *blob)
  • vendor/current/lib/tdr/testsuite.c

    r740 r988  
    2121#include "includes.h"
    2222#include "torture/torture.h"
     23#include "torture/local/proto.h"
    2324#include "lib/tdr/tdr.h"
    2425
Note: See TracChangeset for help on using the changeset viewer.