Skip to content

Commit

Permalink
cgi-bin/admin.c: Prevent accessing ppd_name if ppd_name is NULL
Browse files Browse the repository at this point in the history
The fix provided by Alfonso Gregory, fixes regression after PR #218.
  • Loading branch information
zdohnal committed Sep 8, 2021
1 parent b82b2fb commit 92df865
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions cgi-bin/admin.c
Original file line number Diff line number Diff line change
Expand Up @@ -1218,17 +1218,7 @@ do_am_printer(http_t *http, /* I - HTTP connection */

cgiCopyTemplateLang("printer-modified.tmpl");
}
else if (strcmp(ppd_name, "everywhere") && !strstr(ppd_name, "driverless"))
{
/*
* If we don't have an everywhere model, show printer-added
* template with warning about drivers going away...
*/

cgiStartHTML(title);
cgiCopyTemplateLang("printer-added.tmpl");
}
else
else if (ppd_name && (strcmp(ppd_name, "everywhere") == 0 || strstr(ppd_name, "driverless")))
{
/*
* Set the printer options...
Expand All @@ -1238,6 +1228,16 @@ do_am_printer(http_t *http, /* I - HTTP connection */
do_set_options(http, 0);
return;
}
else
{
/*
* If we don't have an everywhere model, show printer-added
* template with warning about drivers going away...
*/

cgiStartHTML(title);
cgiCopyTemplateLang("printer-added.tmpl");
}

cgiEndHTML();
}
Expand Down

0 comments on commit 92df865

Please sign in to comment.