[libxslt] Fix for bug 436589



commit 02b30799fe2f8a572f6eefb27b2b9f1265fc0db7
Author: Imran Azeezullah <uqsazeez uq edu au>
Date:   Mon Sep 30 10:18:03 2013 +0800

    Fix for bug 436589
    
    https://bugzilla.gnome.org/show_bug.cgi?id=436589
    
    Need to check availablility of argument before scanning it

 xsltproc/xsltproc.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/xsltproc/xsltproc.c b/xsltproc/xsltproc.c
index 45adf5d..b22df37 100644
--- a/xsltproc/xsltproc.c
+++ b/xsltproc/xsltproc.c
@@ -730,6 +730,11 @@ main(int argc, char **argv)
             int value;
 
             i++;
+            if (i == argc) {
+                fprintf(stderr, "XSLT maxdepth value not specified!\n");
+                return (2);
+            }
+
             if (sscanf(argv[i], "%d", &value) == 1) {
                 if (value > 0)
                     xsltMaxDepth = value;
@@ -748,6 +753,11 @@ main(int argc, char **argv)
             int value;
 
             i++;
+            if (i == argc) {
+                fprintf(stderr, "XML maxparserdepth value not specified!\n");
+                return (2);
+            }
+
             if (sscanf(argv[i], "%d", &value) == 1) {
                 if (value > 0)
                     xmlParserMaxDepth = value;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]