Control: retitle -1 "html2text -width" crashes with exit status 139
Control: tags -1 patch

Hi,

this crash is because of improper parsing of input arguments in html2text.C
It occurs when "-width" or "-rcfile" is the last command line argument.
Of course, this is improper usage, but the segfault is still bad.
The patch is:


--- a/html2text.C
+++ b/html2text.C
@@ -295,10 +295,10 @@
     if (!strcmp(arg, "-check"        )) { mode = MyParser::SYNTAX_CHECK;       
           } else
     if (!strcmp(arg, "-debug-scanner")) { debug_scanner = true;                
           } else
     if (!strcmp(arg, "-debug-parser" )) { debug_parser = true;                 
           } else
-    if (!strcmp(arg, "-rcfile"       )) { rcfile = argv[++i];                  
           } else
-    if (!strcmp(arg, "-style"        )) { style = argv[++i];                   
           } else
-    if (!strcmp(arg, "-width"        )) { if (atoi(argv[++i]) > 0) width = 
atoi(argv[i]); } else
-    if (!strcmp(arg, "-o"            )) { output_file_name = argv[++i];        
           } else
+    if (!strcmp(arg, "-rcfile"       )) { if (++i < argc) rcfile = argv[i];    
           } else
+    if (!strcmp(arg, "-style"        )) { if (++i < argc) style = argv[i];     
           } else
+    if (!strcmp(arg, "-width"        )) { if (++i < argc) if (atoi(argv[i]) > 
0) width = atoi(argv[i]); } else
+    if (!strcmp(arg, "-o"            )) { if (++i < argc) output_file_name = 
argv[i];     } else
     if (!strcmp(arg, "-nobs"         )) { use_backspaces = false;              
           } else
     if (!strcmp(arg, "-ascii"        )) { use_encoding = ASCII;                
           } else
     if (!strcmp(arg, "-utf8"         )) { use_encoding = UTF8;                 
           } else


-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to