Function Macro

GLibnewa

Declaration

#define g_newa (
  struct_type,
  n_structs
)

Description

Wraps g_alloca() in a more typesafe manner.

As mentioned in the documentation for g_alloca(), n_structs must always be entirely under the control of the program, or you may introduce a denial of service vulnerability. In addition, the multiplication of struct_type by n_structs is not checked, so an overflow may lead to a remote code execution vulnerability.

Parameters

struct_type none
 

Type of memory chunks to be allocated.

n_structs none
 

Number of chunks to be allocated.