Update.
2004-08-04  Jakub Jelinek  <jakub@redhat.com>

	* resolv/inet_pton.c (inet_pton4): Disallow octal numbers.  Reported
	by A. Guru <a.guru@sympatico.ca>.  [BZ #295]
This commit is contained in:
Ulrich Drepper 2004-08-05 16:27:58 +00:00
parent 2f0cdd2b9e
commit 08bcfb594b
2 changed files with 9 additions and 1 deletions

View File

@ -1,3 +1,8 @@
2004-08-04 Jakub Jelinek <jakub@redhat.com>
* resolv/inet_pton.c (inet_pton4): Disallow octal numbers. Reported
by A. Guru <a.guru@sympatico.ca>. [BZ #295]
2004-08-05 Ulrich Drepper <drepper@redhat.com> 2004-08-05 Ulrich Drepper <drepper@redhat.com>
* po/nl.po: Update from translation team. * po/nl.po: Update from translation team.

View File

@ -69,7 +69,8 @@ libc_hidden_def (inet_pton)
/* int /* int
* inet_pton4(src, dst) * inet_pton4(src, dst)
* like inet_aton() but without all the hexadecimal and shorthand. * like inet_aton() but without all the hexadecimal, octal (with the
* exception of 0) and shorthand.
* return: * return:
* 1 if `src' is a valid dotted quad, else 0. * 1 if `src' is a valid dotted quad, else 0.
* notice: * notice:
@ -94,6 +95,8 @@ inet_pton4(src, dst)
if (ch >= '0' && ch <= '9') { if (ch >= '0' && ch <= '9') {
u_int new = *tp * 10 + (ch - '0'); u_int new = *tp * 10 + (ch - '0');
if (saw_digit && *tp == 0)
return (0);
if (new > 255) if (new > 255)
return (0); return (0);
*tp = new; *tp = new;