PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ lwgeom_from_wkb()

LWGEOM* lwgeom_from_wkb ( const uint8_t wkb,
const size_t  wkb_size,
const char  check 
)

WKB inputs must have a declared size, to prevent malformed WKB from reading off the end of the memory segment (this stops a malevolent user from declaring a one-ring polygon to have 10 rings, causing the WKB reader to walk off the end of the memory).

Check is a bitmask of: LW_PARSER_CHECK_MINPOINTS, LW_PARSER_CHECK_ODD, LW_PARSER_CHECK_CLOSURE, LW_PARSER_CHECK_NONE, LW_PARSER_CHECK_ALL

Definition at line 789 of file lwin_wkb.c.

790 {
792 
793  /* Initialize the state appropriately */
794  s.wkb = wkb;
795  s.wkb_size = wkb_size;
796  s.swap_bytes = LW_FALSE;
797  s.check = check;
798  s.lwtype = 0;
799  s.srid = SRID_UNKNOWN;
800  s.has_z = LW_FALSE;
801  s.has_m = LW_FALSE;
802  s.has_srid = LW_FALSE;
803  s.pos = wkb;
804  s.depth = 1;
805 
806  return lwgeom_from_wkb_state(&s);
807 }
char * s
Definition: cu_in_wkt.c:23
#define LW_FALSE
Definition: liblwgeom.h:77
#define SRID_UNKNOWN
Unknown SRID value.
Definition: liblwgeom.h:188
LWGEOM * lwgeom_from_wkb_state(wkb_parse_state *s)
Internal function declarations.
Definition: lwin_wkb.c:693
Used for passing the parse state between the parsing functions.
Definition: lwin_wkb.c:40

References LW_FALSE, lwgeom_from_wkb_state(), s, and SRID_UNKNOWN.

Referenced by cu_wkb_in(), geography_from_binary(), geography_recv(), lwgeom_from_hexwkb(), LWGEOM_from_WKB(), LWGEOM_in(), LWGEOM_recv(), LWGEOMFromEWKB(), rt_raster_gdal_polygonize(), test_geos_makevalid(), and test_wkb_leak().

Here is the call graph for this function:
Here is the caller graph for this function: