• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

polserver / polserver / 15833161121

23 Jun 2025 07:21PM UTC coverage: 59.115% (+0.06%) from 59.058%
15833161121

push

github

web-flow
Add Packet script method `assign( Packet other )` (#784)

* implementation

* tests

* docs

* remove improper check for is_variable_length in SetInt8
`SetSize` returns false for non-varlength packets

* address Discord comments
- use std::max for packet `newsize`
- use vector assignment operator for copying

12 of 14 new or added lines in 1 file covered. (85.71%)

1 existing line in 1 file now uncovered.

42634 of 72121 relevant lines covered (59.11%)

434361.42 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

13.31
/pol-core/pol/packetscrobj.cpp
1
/** @file
2
 *
3
 * @par History
4
 * - 2005/09/12 Shinigami: added ObjMethods packet.GetIntxxFlipped and packet.SetIntxxFlipped (Byte
5
 * Order)
6
 * - 2006/09/16 Shinigami: added ObjMethods packet.GetUnicodeStringFlipped and
7
 * packet.SetUnicodeStringFlipped (Byte Order)
8
 * - 2006/09/16 Shinigami: fixed Memory Overwrite Bug in packet.SetUnicodeString* ->
9
 * convertArrayToUC
10
 * - 2008/12/17 MuadDib:   fixed Memory Leak in SetSize() where it returns BObjects back
11
 * - to calling Methods where they do not handle a return value.
12
 * - 2009/08/25 Shinigami: STLport-5.2.1 fix: oldsize not used
13
 * - 2009/12/21 Turley:    ._method() call fix
14
 */
15

16

17
#include "packetscrobj.h"
18

19
#include <iomanip>
20
#include <stddef.h>
21

22
#include "../bscript/berror.h"
23
#include "../bscript/bobject.h"
24
#include "../bscript/executor.h"
25
#include "../bscript/impstr.h"
26
#include "../bscript/objmembers.h"
27
#include "../bscript/objmethods.h"
28
#include "../clib/clib_endian.h"
29
#include "../clib/stlutil.h"
30
#include "../clib/strutil.h"
31
#include "base/position.h"
32
#include "globals/network.h"
33
#include "mobile/charactr.h"
34
#include "network/client.h"
35
#include "network/clienttransmit.h"
36
#include "realms/realm.h"
37
#include "realms/realms.h"
38
#include "uoexec.h"
39
#include "uworld.h"
40

41
namespace Pol
42
{
43
namespace Core
44
{
45
using namespace Bscript;
46

47
BPacket::BPacket() : PolObjectImp( OTPacket ), is_variable_length( false ) {}
×
48
BPacket::BPacket( const BPacket& copyfrom )
×
49
    : PolObjectImp( OTPacket ),
50
      buffer( copyfrom.buffer ),
×
51
      is_variable_length( copyfrom.is_variable_length )
×
52
{
53
}
×
54
BPacket::BPacket( u8 type, signed short length ) : PolObjectImp( OTPacket )
4✔
55
{
56
  if ( length == -1 )
4✔
57
  {
58
    is_variable_length = true;
1✔
59
    buffer.resize( 1, type );
1✔
60
  }
61
  else
62
  {
63
    is_variable_length = false;
3✔
64
    if ( length > 0 )
3✔
65
    {
66
      buffer.resize( length, 0 );
1✔
67
      buffer[0] = type;
1✔
68
    }
69
  }
70
}
4✔
71
BPacket::BPacket( const unsigned char* data, unsigned short length, bool variable_len )
×
72
    : PolObjectImp( OTPacket ), buffer( data, data + length )
×
73
{
74
  is_variable_length = variable_len;
×
75
}
×
76
BPacket::~BPacket() {}
8✔
77

78
BObjectRef BPacket::get_member_id( const int /*id*/ )  // id test
×
79
{
80
  return BObjectRef( new BLong( 0 ) );
×
81
}
82
BObjectRef BPacket::get_member( const char* membername )
×
83
{
84
  ObjMember* objmember = getKnownObjMember( membername );
×
85
  if ( objmember != nullptr )
×
86
    return this->get_member_id( objmember->id );
×
87
  else
88
    return BObjectRef( UninitObject::create() );
×
89
}
90

91
BObjectImp* BPacket::call_polmethod_id( const int id, UOExecutor& ex, bool /*forcebuiltin*/ )
6✔
92
{
93
  switch ( id )
6✔
94
  {
95
  case MTH_SENDPACKET:
×
96
  {
97
    if ( ex.numParams() != 1 )
×
98
      return new BError( "SendPacket requires 1 parameter." );
×
99

100
    Mobile::Character* chr = nullptr;
×
101
    Network::Client* client = nullptr;
×
102
    if ( ex.getCharacterOrClientParam( 0, chr, client ) )
×
103
    {
104
      if ( chr != nullptr )
×
105
      {
106
        if ( !chr->has_active_client() )
×
107
          return new BLong( 0 );
×
108

109
        client = chr->client;
×
110
      }
111

112
      if ( client != nullptr )
×
113
      {
114
        if ( client->isConnected() )
×
115
        {
116
          Core::networkManager.clientTransmit->AddToQueue( client, (void*)( &buffer[0] ),
×
117
                                                           static_cast<int>( buffer.size() ) );
×
118
          return new BLong( 1 );
×
119
        }
120
        else
121
          return new BLong( 0 );
×
122
      }
123
    }
124
    break;
×
125
  }
126

127
  case MTH_SENDAREAPACKET:
×
128
  {
129
    if ( ex.numParams() != 4 )
×
130
      return new BError( "SendAreaPacket requires 4 parameters." );
×
131
    Core::Pos2d pos;
×
132
    Realms::Realm* realm;
133
    unsigned short range;
134
    if ( ex.getRealmParam( 3, &realm ) && ex.getPos2dParam( 0, 1, &pos, realm ) &&
×
135
         ex.getParam( 2, range ) )
×
136
    {
137
      unsigned short num_sent_to = 0;
×
138
      Core::WorldIterator<Core::OnlinePlayerFilter>::InRange(
×
139
          pos, realm, range,
140
          [&]( Mobile::Character* chr )
×
141
          {
142
            Core::networkManager.clientTransmit->AddToQueue( chr->client, (void*)( &buffer[0] ),
×
143
                                                             static_cast<int>( buffer.size() ) );
×
144
            num_sent_to++;
×
145
          } );
×
146
      return new BLong( num_sent_to );
×
147
    }
148
    break;
×
149
  }
150

151
  case MTH_GETINT8:
×
152
  {
153
    if ( ex.numParams() != 1 )
×
154
      return new BError( "GetInt8 requires 1 parameter." );
×
155
    unsigned short offset;
156
    if ( ex.getParam( 0, offset ) )
×
157
    {
158
      if ( offset >= buffer.size() )  // don't allow getting bytes past end of buffer
×
159
        return new BError( "Offset too high" );
×
160
      u8* data = reinterpret_cast<u8*>( &buffer[offset] );
×
161
      return new BLong( *data );
×
162
    }
163
    break;
×
164
  }
165

166
  case MTH_GETINT16:
×
167
  {
168
    if ( ex.numParams() != 1 )
×
169
      return new BError( "GetInt16 requires 1 parameter." );
×
170
    unsigned short offset;
171
    if ( ex.getParam( 0, offset ) )
×
172
    {
173
      if ( offset > buffer.size() - sizeof( u16 ) )  // don't allow getting bytes past end of buffer
×
174
        return new BError( "Offset too high" );
×
175
      u16* data = reinterpret_cast<u16*>( &buffer[offset] );
×
176
      return new BLong( cfBEu16( *data ) );
×
177
    }
178
    break;
×
179
  }
180

181
  case MTH_GETINT32:
×
182
  {
183
    if ( ex.numParams() != 1 )
×
184
      return new BError( "GetInt32 requires 1 parameter." );
×
185
    unsigned short offset;
186
    if ( ex.getParam( 0, offset ) )
×
187
    {
188
      if ( offset > buffer.size() - sizeof( u32 ) )  // don't allow getting bytes past end of buffer
×
189
        return new BError( "Offset too high" );
×
190
      u32* data = reinterpret_cast<u32*>( &buffer[offset] );
×
191
      return new BLong( cfBEu32( *data ) );
×
192
    }
193
    break;
×
194
  }
195

196
  case MTH_GETINT16FLIPPED:
×
197
  {
198
    if ( ex.numParams() != 1 )
×
199
      return new BError( "GetInt16Flipped requires 1 parameter." );
×
200
    unsigned short offset;
201
    if ( ex.getParam( 0, offset ) )
×
202
    {
203
      if ( offset > buffer.size() - sizeof( u16 ) )  // don't allow getting bytes past end of buffer
×
204
        return new BError( "Offset too high" );
×
205
      u16* data = reinterpret_cast<u16*>( &buffer[offset] );
×
206
      return new BLong( cfLEu16( *data ) );
×
207
    }
208
    break;
×
209
  }
210

211
  case MTH_GETINT32FLIPPED:
×
212
  {
213
    if ( ex.numParams() != 1 )
×
214
      return new BError( "GetInt32Flipped requires 1 parameter." );
×
215
    unsigned short offset;
216
    if ( ex.getParam( 0, offset ) )
×
217
    {
218
      if ( offset > buffer.size() - sizeof( u32 ) )  // don't allow getting bytes past end of buffer
×
219
        return new BError( "Offset too high" );
×
220
      u32* data = reinterpret_cast<u32*>( &buffer[offset] );
×
221
      return new BLong( cfLEu32( *data ) );
×
222
    }
223
    break;
×
224
  }
225

226
  case MTH_GETSTRING:
×
227
  {
228
    if ( ex.numParams() != 2 )
×
229
      return new BError( "GetString requires 2 parameter." );
×
230
    unsigned short offset, len;
231
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, len ) )
×
232
    {
233
      if ( ( offset >= buffer.size() ) ||
×
234
           ( static_cast<u16>( offset + len ) >
×
235
             buffer.size() ) )  // don't allow getting bytes past end of buffer
×
236
        return new BError( "Offset too high" );
×
237

238
      const char* str_offset = reinterpret_cast<const char*>( &buffer[offset] );
×
239
      size_t real_len = 0;
×
240

241
      // Returns maximum of len characters or up to the first null-byte
242
      while ( real_len < len && *( str_offset + real_len ) )
×
243
        ++real_len;
×
244

245
      return new String( str_offset, real_len, String::Tainted::YES );
×
246
    }
247
    break;
×
248
  }
249

250
  case MTH_GETUNICODESTRING:
×
251
  {
252
    if ( ex.numParams() != 2 )
×
253
      return new BError( "GetUnicodeString requires 2 parameter." );
×
254
    unsigned short offset, len;
255
    if ( ex.getParam( 0, offset ) &&
×
256
         ex.getParam( 1, len ) )  // len is in unicode characters, not bytes
×
257
    {
258
      if ( ( offset >= buffer.size() ) ||
×
259
           ( static_cast<u16>( offset + len * 2 ) >
×
260
             buffer.size() ) )  // don't allow getting bytes past end of buffer
×
261
        return new BError( "Offset too high" );
×
262
      std::string str =
263
          Bscript::String::fromUTF16( reinterpret_cast<u16*>( &buffer[offset] ), len, true );
×
264
      return new Bscript::String( str );
×
265
    }
×
266
    break;
×
267
  }
268

269
  case MTH_GETUNICODESTRINGFLIPPED:
×
270
  {
271
    if ( ex.numParams() != 2 )
×
272
      return new BError( "GetUnicodeStringFlipped requires 2 parameter." );
×
273
    unsigned short offset, len;
274
    if ( ex.getParam( 0, offset ) &&
×
275
         ex.getParam( 1, len ) )  // len is in unicode characters, not bytes
×
276
    {
277
      if ( ( offset >= buffer.size() ) ||
×
278
           ( static_cast<u16>( offset + len * 2 ) >
×
279
             buffer.size() ) )  // don't allow getting bytes past end of buffer
×
280
        return new BError( "Offset too high" );
×
281
      std::string str =
282
          Bscript::String::fromUTF16( reinterpret_cast<u16*>( &buffer[offset] ), len );
×
283
      return new Bscript::String( str );
×
284
    }
×
285
    break;
×
286
  }
287

288
  case MTH_GETSIZE:
×
289
    return new BLong( static_cast<int>( buffer.size() ) );
×
290

291
  case MTH_SETSIZE:
×
292
  {
293
    if ( ex.numParams() != 1 )
×
294
      return new BError( "SetSize requires 1 parameter." );
×
295
    unsigned short newsize;
296
    if ( ex.getParam( 0, newsize ) )
×
297
    {
298
      return SetSize( newsize, true );
×
299
    }
300
    break;
×
301
  }
302

303
  case MTH_SETINT8:
4✔
304
  {
305
    if ( ex.numParams() != 2 )
4✔
306
      return new BError( "SetInt8 requires 2 parameters." );
4✔
307
    unsigned short offset, value;
308
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, value ) )
4✔
309
    {
310
      if ( offset >= buffer.size() )
4✔
311
      {
312
        if ( !SetSize( ( offset + sizeof( u8 ) ) ) )
3✔
313
        {
314
          return new BError( "Offset value out of range on a fixed length packet" );
1✔
315
        }
316
      }
317
      buffer[offset] = static_cast<u8>( value );
3✔
318
      return new BLong( 1 );
3✔
319
    }
320
    break;
×
321
  }
322

323
  case MTH_SETINT16:
×
324
  {
325
    if ( ex.numParams() != 2 )
×
326
      return new BError( "SetInt16 requires 2 parameters." );
×
327
    unsigned short offset, value;
328
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, value ) )
×
329
    {
330
      if ( static_cast<u16>( offset + sizeof( u16 ) ) > buffer.size() )
×
331
      {
332
        if ( !SetSize( ( offset + sizeof( u16 ) ) ) )
×
333
        {
334
          return new BError( "Offset value out of range on a fixed length packet" );
×
335
          ;
336
        }
337
      }
338

339
      u16* bufptr = reinterpret_cast<u16*>( &buffer[offset] );
×
340
      *bufptr = ctBEu16( static_cast<u16>( value ) );
×
341
      return new BLong( 1 );
×
342
    }
343
    break;
×
344
  }
345

346
  case MTH_SETINT32:
×
347
  {
348
    if ( ex.numParams() != 2 )
×
349
      return new BError( "SetInt32 requires 2 parameters." );
×
350
    unsigned short offset;
351
    int lvalue;
352
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, lvalue ) )
×
353
    {
354
      if ( static_cast<u32>( offset + sizeof( u32 ) ) > buffer.size() )
×
355
      {
356
        if ( !SetSize( offset + sizeof( u32 ) ) )
×
357
        {
358
          return new BError( "Offset value out of range on a fixed length packet" );
×
359
          ;
360
        }
361
      }
362

363
      u32* bufptr = reinterpret_cast<u32*>( &buffer[offset] );
×
364
      *bufptr = ctBEu32( static_cast<u32>( lvalue ) );
×
365
      return new BLong( 1 );
×
366
    }
367
    break;
×
368
  }
369

370
  case MTH_SETINT16FLIPPED:
×
371
  {
372
    if ( ex.numParams() != 2 )
×
373
      return new BError( "SetInt16Flipped requires 2 parameters." );
×
374
    unsigned short offset, value;
375
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, value ) )
×
376
    {
377
      if ( static_cast<u16>( offset + sizeof( u16 ) ) > buffer.size() )
×
378
      {
379
        if ( !SetSize( ( offset + sizeof( u16 ) ) ) )
×
380
        {
381
          return new BError( "Offset value out of range on a fixed length packet" );
×
382
          ;
383
        }
384
      }
385

386
      u16* bufptr = reinterpret_cast<u16*>( &buffer[offset] );
×
387
      *bufptr = ctLEu16( static_cast<u16>( value ) );
×
388
      return new BLong( 1 );
×
389
    }
390
    break;
×
391
  }
392

393
  case MTH_SETINT32FLIPPED:
×
394
  {
395
    if ( ex.numParams() != 2 )
×
396
      return new BError( "SetInt32Flipped requires 2 parameters." );
×
397
    unsigned short offset;
398
    int lvalue;
399
    if ( ex.getParam( 0, offset ) && ex.getParam( 1, lvalue ) )
×
400
    {
401
      if ( static_cast<u32>( offset + sizeof( u32 ) ) > buffer.size() )
×
402
      {
403
        if ( !SetSize( ( offset + sizeof( u32 ) ) ) )
×
404
        {
405
          return new BError( "Offset value out of range on a fixed length packet" );
×
406
          ;
407
        }
408
      }
409
      u32* bufptr = reinterpret_cast<u32*>( &buffer[offset] );
×
410
      *bufptr = ctLEu32( static_cast<u32>( lvalue ) );
×
411
      return new BLong( 1 );
×
412
    }
413
    break;
×
414
  }
415

416
  case MTH_SETSTRING:
×
417
  {
418
    if ( ex.numParams() != 3 )
×
419
      return new BError( "SetString requires 3 parameters." );
×
420
    unsigned short offset, nullterm;
421
    const String* text;
422
    if ( ex.getParam( 0, offset ) && ex.getStringParam( 1, text ) && ex.getParam( 2, nullterm ) )
×
423
    {
424
      std::string cp1252text;
×
425
      if ( text->hasUTF8Characters() )
×
426
      {
427
        cp1252text = Clib::strUtf8ToCp1252( text->value() );
×
428
      }
429
      else
430
      {
431
        cp1252text = text->value();
×
432
      }
433
      u16 textlen = static_cast<u16>( cp1252text.length() );
×
434
      if ( static_cast<u16>( offset + textlen + nullterm ) > buffer.size() )
×
435
      {
436
        if ( !SetSize( ( offset + textlen + nullterm ) ) )
×
437
        {
438
          return new BError( "Offset value out of range on a fixed length packet" );
×
439
        }
440
      }
441
      u8* bufptr = reinterpret_cast<u8*>( &buffer[offset] );
×
442
      const char* textptr = cp1252text.c_str();
×
443
      for ( u16 i = 0; i < textlen; i++ )
×
444
      {
445
        bufptr[i] = textptr[i];
×
446
      }
447

448
      if ( nullterm )
×
449
        bufptr[textlen] = 0;
×
450

451
      return new BLong( 1 );
×
452
    }
×
453
    break;
×
454
  }
455
  case MTH_SETUTF8STRING:
×
456
  {
457
    if ( ex.numParams() != 3 )
×
458
      return new BError( "SetUtf8String requires 3 parameters." );
×
459
    unsigned short offset, nullterm;
460
    const String* text;
461
    if ( ex.getParam( 0, offset ) && ex.getStringParam( 1, text ) && ex.getParam( 2, nullterm ) )
×
462
    {
463
      u16 textlen = static_cast<u16>( text->value().length() );
×
464
      if ( static_cast<u16>( offset + textlen + nullterm ) > buffer.size() )
×
465
      {
466
        if ( !SetSize( ( offset + textlen + nullterm ) ) )
×
467
        {
468
          return new BError( "Offset value out of range on a fixed length packet" );
×
469
        }
470
      }
471
      u8* bufptr = reinterpret_cast<u8*>( &buffer[offset] );
×
472
      const char* textptr = text->value().c_str();
×
473
      for ( u16 i = 0; i < textlen; i++ )
×
474
        bufptr[i] = textptr[i];
×
475

476
      if ( nullterm )
×
477
        bufptr[textlen] = 0;
×
478

479
      return new BLong( 1 );
×
480
    }
481
    break;
×
482
  }
483
  case MTH_SETUNICODESTRING:
×
484
  {
485
    if ( ex.numParams() != 3 )
×
486
      return new BError( "SetUnicodeString requires 3 parameters." );
×
487
    unsigned short offset, nullterm;
488
    const String* unitext;
489
    if ( ex.getParam( 0, offset ) && ex.getUnicodeStringParam( 1, unitext ) &&
×
490
         ex.getParam( 2, nullterm ) )
×
491
    {
492
      std::vector<u16> gwtext = unitext->toUTF16();
×
493
      if ( nullterm )
×
494
        gwtext.push_back( 0 );
×
495
      u16 bytelen = static_cast<u16>( gwtext.size() ) * 2;
×
496
      if ( static_cast<u16>( offset + bytelen ) > buffer.size() )
×
497
      {
498
        if ( !SetSize( ( offset + bytelen ) ) )
×
499
        {
500
          return new BError( "Offset value out of range on a fixed length packet" );
×
501
        }
502
      }
503
      for ( const auto& c : gwtext )
×
504
      {
505
        u16 fc = cfBEu16( c );
×
506
        std::memcpy( &buffer[offset], &fc, sizeof( fc ) );
×
507
        offset += 2;
×
508
      }
509

510
      return new BLong( 1 );
×
511
    }
×
512
    break;
×
513
  }
514
  case MTH_SETUNICODESTRINGFLIPPED:
×
515
  {
516
    if ( ex.numParams() != 3 )
×
517
      return new BError( "SetUnicodeStringFlipped requires 3 parameters." );
×
518
    unsigned short offset, nullterm;
519
    const String* unitext;
520
    if ( ex.getParam( 0, offset ) && ex.getUnicodeStringParam( 1, unitext ) &&
×
521
         ex.getParam( 2, nullterm ) )
×
522
    {
523
      std::vector<u16> gwtext = unitext->toUTF16();
×
524
      if ( nullterm )
×
525
        gwtext.push_back( 0 );
×
526
      u16 bytelen = static_cast<u16>( gwtext.size() ) * 2;
×
527

528
      if ( static_cast<u16>( offset + bytelen ) > buffer.size() )
×
529
      {
530
        if ( !SetSize( offset + bytelen ) )
×
531
        {
532
          return new BError( "Offset value out of range on a fixed length packet" );
×
533
          ;
534
        }
535
      }
536
      for ( const auto& c : gwtext )
×
537
      {
538
        std::memcpy( &buffer[offset], &c, sizeof( c ) );
×
539
        offset += 2;
×
540
      }
541
      return new BLong( 1 );
×
542
    }
×
543
    break;
×
544
  }
545
  case MTH_ASSIGN:
2✔
546
  {
547
    if ( ex.numParams() < 1 )
2✔
NEW
548
      return new BError( "Invalid parameter type" );
×
549

550
    BObjectImp* param0 = ex.getParamImp( 0, BObjectType::OTPacket );
2✔
551

552
    if ( !param0 )
2✔
NEW
553
      return new BError( "Invalid parameter type" );
×
554

555
    BPacket* other = static_cast<BPacket*>( param0 );
2✔
556
    is_variable_length = other->is_variable_length;
2✔
557
    buffer = other->buffer;
2✔
558
    return new BLong( 1 );
2✔
559
  }
560
  default:
×
561
    return nullptr;
×
562
  }
563
  return new BError( "Invalid parameter" );
×
564
}
565

566

567
BObjectImp* BPacket::call_polmethod( const char* methodname, UOExecutor& ex )
×
568
{
569
  ObjMethod* objmethod = getKnownObjMethod( methodname );
×
570
  if ( objmethod != nullptr )
×
571
    return this->call_polmethod_id( objmethod->id, ex );
×
572
  else
573
    return nullptr;
×
574
}
575
BObjectImp* BPacket::copy() const
×
576
{
577
  return new BPacket( *this );
×
578
}
579
std::string BPacket::getStringRep() const
5✔
580
{
581
  OSTRINGSTREAM os;
5✔
582
  for ( auto itr = buffer.begin(); itr != buffer.end(); ++itr )
22✔
583
    os << std::setfill( '0' ) << std::setw( 2 ) << std::hex << static_cast<u16>( *itr );
17✔
584

585
  return OSTRINGSTREAM_STR( os );
10✔
586
}
5✔
587

588
bool BPacket::SetSize( u16 newsize )
3✔
589
{
590
  if ( !is_variable_length )
3✔
591
    return false;
1✔
592
  newsize = std::max(newsize, 3_u16);
2✔
593
  buffer.resize( newsize );
2✔
594
  u16* sizeptr = reinterpret_cast<u16*>( &buffer[1] );
2✔
595
  *sizeptr = ctBEu16( newsize );
2✔
596
  return true;
2✔
597
}
598

599
BObjectImp* BPacket::SetSize( u16 newsize, bool /*giveReturn*/ )
×
600
{
601
  if ( !is_variable_length )
×
602
    return new BError( "Attempted to resize a fixed length packet" );
×
603
  unsigned short oldsize = static_cast<unsigned short>( buffer.size() );
×
604
  buffer.resize( newsize );
×
605
  u16* sizeptr = reinterpret_cast<u16*>( &buffer[1] );
×
606
  *sizeptr = ctBEu16( newsize );
×
607
  return new BLong( oldsize );
×
608
}
609
}  // namespace Core
610
}  // namespace Pol
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc