aboutsummaryrefslogtreecommitdiffstats
path: root/uri.c
diff options
context:
space:
mode:
authorAleksey Sanin <aleksey@src.gnome.org>2002-06-14 17:07:10 +0000
committerAleksey Sanin <aleksey@src.gnome.org>2002-06-14 17:07:10 +0000
commit49cc97565fbe2928388a1e437c44429097a504ae (patch)
treee96c37456485dd61090411351595f4fb820c73b0 /uri.c
parente059b891efee0c1834c8a02358eb57cca6587177 (diff)
downloadandroid_external_libxml2-49cc97565fbe2928388a1e437c44429097a504ae.tar.gz
android_external_libxml2-49cc97565fbe2928388a1e437c44429097a504ae.tar.bz2
android_external_libxml2-49cc97565fbe2928388a1e437c44429097a504ae.zip
replaced sprintf() with snprintf() to prevent possible buffer overflow
* DOCBparser.c HTMLparser.c debugXML.c encoding.c nanoftp.c nanohttp.c parser.c tree.c uri.c xmlIO.c xmllint.c xpath.c: replaced sprintf() with snprintf() to prevent possible buffer overflow (the bug was pointed out by Anju Premachandran)
Diffstat (limited to 'uri.c')
-rw-r--r--uri.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/uri.c b/uri.c
index b2198809..ef9ca12d 100644
--- a/uri.c
+++ b/uri.c
@@ -372,7 +372,7 @@ xmlSaveUri(xmlURIPtr uri) {
return(NULL);
}
}
- len += sprintf((char *) &ret[len], ":%d", uri->port);
+ len += snprintf((char *) &ret[len], max - len, ":%d", uri->port);
}
} else if (uri->authority != NULL) {
if (len + 3 >= max) {