View Ticket
Not logged in
Ticket Hash: 94eb59015ab5c7fbd871460067e5eeb112d3f313
Title: fnct_sp_stored_execute: Invalid free() / delete / delete[] / realloc() for 'blob'
Status: Fixed Type: Code_Defect
Severity: Critical Priority: Immediate
Subsystem: Resolution: Fixed
Last Modified: 2018-01-10 10:50:33
Version Found In: development
User Comments:
mj10777 added on 2017-12-04 05:56:21:

While 'playing around' with Stored Procedures, as always, creating a problem that has yet been determined around:

Conditional jump or move depends on uninitialised value(s)
at 0x52014A4: gaia_sql_proc_cooked_sql (stored_procedures.c:1081)
by 0x4EFA773: fnct_sp_stored_execute (spatialite.c:32704)
another problem has been noticed in fnct_sp_stored_execute:
During
sql_error:
// ==18309== Invalid free() / delete / delete[] / realloc()
// ==18309==    at 0x4C2BD2F: free (vg_replace_malloc.c:530)
// ==18309==    by 0x4EFA715: fnct_sp_stored_execute (spatialite.c:32761)
    blob is, again, being freed
    done after 'gaia_sql_proc_cooked_sql'
    Start value of 'blob' is not set to NULL
    After free 'blob' is not set to NULL
    No checking for NULL before free
    Which is done in
      not_an_sql_proc: [justified]
      err_variables: [justified]
      illegal_variables: [justified]
      cooking_error: [justified]
      sql_error: [unjustified, since it is always called after free]

Setting the pointer start value (and after free) to NULL is advised
Checking for NULL is also.
free is not needed during 'sql_error:', since it is called after 'blob' has been freed.


sandro added on 2018-01-10 10:50:33:
fixed by commit 48f0d9139e