- Do not forward blank environment variables (name is empty string)
into the environment of he called filter/backend.
- Do not match a given env variable name with a part of an existing
name (like CUPS_SERVER with CUPS_SERVERBIN). This way CUPS_SERVER in
the environment of the caller overwrote CUPS_SERVERBIN in the
environment of the filter to be called.
name_len;
- if (!name || !env)
+ if (!name || !env || !name[0])
return (-1);
/* Assemble a "VAR=VALUE" string and the string length of "VAR" */
value if it is there */
if (*env)
for (i = 0; (*env)[i]; i ++)
- if (strncmp((*env)[i], p, name_len) == 0)
+ if (strncmp((*env)[i], p, name_len) == 0 && (*env)[i][name_len] == '=')
{
free((*env)[i]);
(*env)[i] = p;