osalvador / tePLSQL

PL/SQL Template engine
http://osalvador.github.io/tePLSQL/
MIT License
65 stars 18 forks source link

including templates with long names throws "sting buffer too small" #25

Closed MikeKutz closed 6 years ago

MikeKutz commented 8 years ago

This affects templates stored in the table TE_TEMPLATES.

The column TE_TEMPLATES.NAME is defined as VARCHAR2(300);

If you include a template whose character length is >64 characters, the rendering engine will throw "string buffer too small" error.

MK

MikeKutz commented 6 years ago

To reproduce, use a name longer than 64 characters.

Example:

DECLARE
  P_VARS TEPLSQL.t_assoc_array;
  P_TEMPLATE CLOB;
  v_ReturnValue  CLOB;
BEGIN
  P_VARS := TEPLSQL.null_assoc_array;
  P_TEMPLATE := ' hello world
  <%@ include( 1234567890123456789012345678901234567890123456789012345678901324567890 ) %>
  ';
  P_ERROR_TEMPLATE := NULL;

  v_ReturnValue := TEPLSQL.render(P_VARS => P_VARS,
P_TEMPLATE => P_TEMPLATE );
  DBMS_OUTPUT.PUT_LINE( v_ReturnValue);
END;