~ubuntu-branches/ubuntu/lucid/mysql-dfsg-5.1/lucid-security

« back to all changes in this revision

Viewing changes to sql/spatial.h

  • Committer: Package Import Robot
  • Author(s): Marc Deslauriers
  • Date: 2013-07-22 15:07:29 UTC
  • mfrom: (1.2.4)
  • Revision ID: package-import@ubuntu.com-20130722150729-aowg83m93ncg1ils
Tags: 5.1.70-0ubuntu0.10.04.1
* SECURITY UPDATE: Update to 5.1.70 to fix security issues (LP: #1203828)
  - http://www.oracle.com/technetwork/topics/security/cpujuly2013-1899826.html
  - CVE-2013-1861
  - CVE-2013-3802
  - CVE-2013-3804
* SECURITY UPDATE: insecure creation of debian.cnf file
  - debian/mysql-server-5.1.postinst: set umask to 066 before creating
    debian.cnf.
  - CVE-2013-2162

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
 
   Copyright (c) 2002, 2012, Oracle and/or its affiliates. All rights reserved.
 
2
   Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
3
3
 
4
4
   This program is free software; you can redistribute it and/or modify
5
5
   it under the terms of the GNU General Public License as published by
22
22
 
23
23
const uint SRID_SIZE= 4;
24
24
const uint SIZEOF_STORED_DOUBLE= 8;
25
 
const uint POINT_DATA_SIZE= SIZEOF_STORED_DOUBLE*2; 
 
25
const uint POINT_DATA_SIZE= (SIZEOF_STORED_DOUBLE * 2); 
26
26
const uint WKB_HEADER_SIZE= 1+4;
27
27
const uint32 GET_SIZE_ERROR= ((uint32) -1);
28
28
 
317
317
  const char *get_mbr_for_points(MBR *mbr, const char *data, uint offset)
318
318
    const;
319
319
 
320
 
  inline bool no_data(const char *cur_data, uint32 data_amount) const
 
320
  /**
 
321
     Check if there're enough data remaining as requested
 
322
 
 
323
     @arg cur_data     pointer to the position in the binary form
 
324
     @arg data_amount  number of points expected
 
325
     @return           true if not enough data
 
326
  */
 
327
  inline bool no_data(const char *cur_data, size_t data_amount) const
321
328
  {
322
329
    return (cur_data + data_amount > m_data_end);
323
330
  }
 
331
 
 
332
  /**
 
333
     Check if there're enough points remaining as requested
 
334
 
 
335
     Need to perform the calculation in logical units, since multiplication
 
336
     can overflow the size data type.
 
337
 
 
338
     @arg data              pointer to the begining of the points array
 
339
     @arg expected_points   number of points expected
 
340
     @arg extra_point_space extra space for each point element in the array
 
341
     @return               true if there are not enough points
 
342
  */
 
343
  inline bool not_enough_points(const char *data, uint32 expected_points,
 
344
                                uint32 extra_point_space = 0) const
 
345
  {
 
346
    return (m_data_end < data ||
 
347
            (expected_points > ((m_data_end - data) /
 
348
                                (POINT_DATA_SIZE + extra_point_space))));
 
349
  }
324
350
  const char *m_data;
325
351
  const char *m_data_end;
326
352
};