diff options
author | Tor Andersson <tor@ghostscript.com> | 2009-12-03 15:36:49 +0100 |
---|---|---|
committer | Tor Andersson <tor@ghostscript.com> | 2009-12-03 15:36:49 +0100 |
commit | c639b84d440cac6dc6e3406fbf647a4bd219ca6f (patch) | |
tree | fd861b1506cc14f2e05b3d1425dbb1bfe0821a79 /apps/unix | |
parent | 02cc12ac3d22e36454fa8564fbe8c111f44d09b7 (diff) | |
download | mupdf-c639b84d440cac6dc6e3406fbf647a4bd219ca6f.tar.xz |
Fix possible buffer overflows in the viewer application.
Diffstat (limited to 'apps/unix')
-rw-r--r-- | apps/unix/x11pdf.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/apps/unix/x11pdf.c b/apps/unix/x11pdf.c index 68c93ac1..20b9d79e 100644 --- a/apps/unix/x11pdf.c +++ b/apps/unix/x11pdf.c @@ -428,12 +428,10 @@ void onselreq(Window requestor, Atom selection, Atom target, Atom property, Time void winopenuri(pdfapp_t *app, char *buf) { - char cmd[2048]; - if (getenv("BROWSER")) - sprintf(cmd, "$BROWSER %s &", buf); - else - sprintf(cmd, "open %s", buf); - system(cmd); + char *browser = getenv("BROWSER"); + if (!browser) + browser = "open"; + execlp(browser, browser, buf, 0); } static void onkey(int c) |