[Gambas-bugtracker] Bug #1529: HtmlDocument.HtmlFromString does not catch some invalid strings

bugtracker at gambaswiki.org bugtracker at gambaswiki.org
Wed Feb 13 02:16:35 CET 2019


http://gambaswiki.org/bugtracker/edit?object=BUG.1529&from=L21haW4-

T. Lee DAVIDSON reported a new bug.

Summary
-------

HtmlDocument.HtmlFromString does not catch some invalid strings

Type             : Bug
Priority         : Low
Gambas version   : 3.12
Product          : XML components


Description
-----------

I have to assume that when the Wiki [0] says, "If the given string is invalid, then an error will be raised," that it means that if the given string is not valid XML an error is raised. However, the method does not catch the invalidity of some binary strings.

Even though feeding the method binary data is probably misuse, it seems that it should catch that.

I fed it PDF, ODT, ICO, and ZIP files. It rightly raises and error on the PDF and ODT files. It eats, without error, the favicon. And, chokes on the ZIP file causing the program to hang.

[0] http://gambaswiki.org/wiki/comp/gb.xml/xmldocument/htmlfromstring


System information
------------------

[System]
Gambas=3.12.90 e467d664c (master)
OperatingSystem=Linux
Kernel=4.4.165-81-default
Architecture=x86_64
Distribution=openSUSE Leap 42.3
Desktop=KDE5
Theme=QtCurve
Language=en_US.UTF-8
Memory=3951M

[Libraries]
Cairo=/usr/lib64/libcairo.so.2.11502.0
Curl=/usr/lib64/libcurl.so.4.3.0
DBus=/lib64/libdbus-1.so.3.8.14
GStreamer=/usr/lib64/libgstreamer-0.10.so.0.30.0
GStreamer=/usr/lib64/libgstreamer-1.0.so.0.803.0
GTK+2=/usr/lib64/libgtk-x11-2.0.so.0.2400.31
GTK+3=/usr/lib64/libgtk-3.so.0.2000.10
OpenGL=/usr/lib64/libGL.so.1.2.0
Poppler=/usr/lib64/libpoppler.so.60.0.0
QT4=/usr/lib64/libQtCore.so.4.8.7
QT5=/usr/lib64/libQt5Core.so.5.6.2
SDL=/usr/lib64/libSDL-1.2.so.0.11.4
SQLite=/usr/lib64/libsqlite3.so.0.8.6

[Environment]
ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
AUDIODRIVER=pulseaudio
COLORTERM=1
CONFIG_SITE=/usr/share/site/x86_64-unknown-linux-gnu
CPU=x86_64
CSHEDIT=emacs
CVS_RSH=ssh
DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-zBWiqk4h0x,guid=252f96c0cc2313f8de42943f5c532800
DESKTOP_SESSION=/usr/share/xsessions/plasma5
DISPLAY=:0
FROM_HEADER=
GB_GUI=gb.qt5
GOARCH=amd64
GOOS=linux
GOPATH=<home>/go:/usr/share/go/1.9/contrib
GOROOT=/usr/lib64/go/1.9
GPG_AGENT_INFO=/tmp/gpg-oLEFoq/S.gpg-agent:2400:1
GPG_TTY=not a tty
GS_LIB=<home>/.fonts
GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:<home>/.gtkrc-2.0
GTK_IM_MODULE=cedilla
GTK_MODULES=canberra-gtk-module
G_BROKEN_FILENAMES=1
G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
HISTSIZE=1000
HOME=<home>
HOST=<hostname>
HOSTNAME=<hostname>
HOSTTYPE=x86_64
INPUTRC=<home>/.inputrc
JAVA_BINDIR=/usr/lib64/jvm/java/bin
JAVA_HOME=/usr/lib64/jvm/java
JAVA_ROOT=/usr/lib64/jvm/java
JDK_HOME=/usr/lib64/jvm/java
JRE_HOME=/usr/lib64/jvm/java/jre
KDE_FULL_SESSION=true
KDE_SESSION_UID=1000
KDE_SESSION_VERSION=5
KOTLIN_HOME=<home>/.sdkman/candidates/kotlin/current
LANG=en_US.UTF-8
LESS=-M -I -R
LESSCLOSE=lessclose.sh %s %s
LESSKEY=/etc/lesskey.bin
LESSOPEN=lessopen.sh %s
LESS_ADVANCED_PREPROCESSOR=no
LE_WORKING_DIR=<home>/.acme.sh
LOGNAME=<user>
MACHTYPE=x86_64-suse-linux
MAIL=/var/spool/mail/<user>
MANPATH=/usr/local/man:/usr/share/man
MINICOM=-c on
MORE=-sl
NNTPSERVER=news
OSTYPE=linux
PAGER=less
PATH=<home>/.sdkman/candidates/kotlin/current/bin:<home>/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
PROFILEREAD=true
PULSE_PROP_OVERRIDE_application.icon_name=plasma
PULSE_PROP_OVERRIDE_application.name=Plasma
PULSE_PROP_OVERRIDE_application.version=5.8.7
PWD=<home>
PYTHONSTARTUP=/etc/pythonstart
QEMU_AUDIO_DRV=pa
QMLSCENE_DEVICE=
QSG_RENDER_LOOP=
QT_AUTO_SCREEN_SCALE_FACTOR=0
QT_IM_MODULE=xim
QT_IM_SWITCHER=imsw-multi
QT_SYSTEM_DIR=/usr/share/desktop-data
SDKMAN_CANDIDATES_DIR=<home>/.sdkman/candidates
SDKMAN_CURRENT_API=https://api.sdkman.io/2
SDKMAN_DIR=<home>/.sdkman
SDKMAN_LEGACY_API=https://api.sdkman.io/1
SDKMAN_PLATFORM=Linux64
SDKMAN_VERSION=5.5.13+272
SDK_HOME=/usr/lib64/jvm/java
SDL_AUDIODRIVER=pulse
SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/2468,unix/<hostname>:/tmp/.ICE-unix/2468
SHELL=/bin/bash
SHLVL=2
SSH_AGENT_PID=2399
SSH_ASKPASS=/usr/lib/ssh/ksshaskpass
SSH_AUTH_SOCK=/tmp/ssh-Ob3ovMoxbShy/agent.2282
TERM=xterm
TZ=:/etc/localtime
USER=<user>
VDPAU_DRIVER=va_gl
WINDOWMANAGER=/usr/bin/startkde
XAUTHLOCALHOSTNAME=<hostname>
XAUTHORITY=<home>/.Xauthority
XCURSOR_SIZE=0
XCURSOR_THEME=breeze_cursors
XDG_CONFIG_DIRS=/etc/xdg
XDG_CURRENT_DESKTOP=KDE
XDG_DATA_DIRS=/usr/share
XDG_RUNTIME_DIR=/run/user/1000
XDG_SEAT=seat0
XDG_SEAT_PATH=/org/freedesktop/DisplayManager/Seat0
XDG_SESSION_CLASS=user
XDG_SESSION_DESKTOP=KDE
XDG_SESSION_ID=2
XDG_SESSION_PATH=/org/freedesktop/DisplayManager/Session2
XDG_SESSION_TYPE=x11
XDG_VTNR=7
XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
XMODIFIERS=@im=local
XNLSPATH=/usr/share/X11/nls
XSESSION_IS_UP=yes
_=/usr/bin/kstart




More information about the Bugtracker mailing list