GNU bug report logs - #73337
29.4; missing dynamic type checking in network-lookup-address-info

Previous Next

Package: emacs;

Reported by: Jonathan Mitchell <mitchell.jkyle <at> gmail.com>

Date: Wed, 18 Sep 2024 15:09:02 UTC

Severity: normal

Tags: fixed

Found in version 29.4

Fixed in version 30.1

Done: Robert Pluim <rpluim <at> gmail.com>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 73337 in the body.
You can then email your comments to 73337 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#73337; Package emacs. (Wed, 18 Sep 2024 15:09:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jonathan Mitchell <mitchell.jkyle <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 18 Sep 2024 15:09:02 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jonathan Mitchell <mitchell.jkyle <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; missing dynamic type checking in network-lookup-address-info
Date: Wed, 18 Sep 2024 10:07:25 -0500
[Message part 1 (text/plain, inline)]
There is no dynamic type checking of the ‘name’ argument in
‘network-lookup-address-info’, thus causing a crash instead of signaling
a wrong-type-argument error when called with non-string values like
‘(network-lookup-address-info 1)’ or ‘(network-lookup-address-info ’a)’.


In GNU Emacs 29.4 (build 1, x86_64-redhat-linux-gnu, GTK+ Version
 3.24.42, cairo version 1.18.0) of 2024-07-16 built on
 27527c2e06f843c0962737354e0b3cf7
System Description: Fedora Linux 40.20240914.0 (Silverblue)

Configured using:
 'configure --build=x86_64-redhat-linux-gnu
 --host=x86_64-redhat-linux-gnu --program-prefix=
 --disable-dependency-tracking --prefix=/usr --exec-prefix=/usr
 --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc
 --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib64
 --libexecdir=/usr/libexec --localstatedir=/var --runstatedir=/run
 --sharedstatedir=/var/lib --mandir=/usr/share/man
 --infodir=/usr/share/info --with-cairo --with-dbus --with-gif
 --with-gpm=no --with-harfbuzz --with-jpeg --with-json --with-modules
 --with-native-compilation=aot --with-pgtk --with-png --with-rsvg
 --with-sqlite3 --with-tiff --with-tree-sitter --with-webp --with-xpm
 --with-xwidgets build_alias=x86_64-redhat-linux-gnu
 host_alias=x86_64-redhat-linux-gnu CC=gcc 'CFLAGS=-DMAIL_USE_LOCKF -O2
 -flto=auto -ffat-lto-objects -fexceptions -g -grecord-gcc-switches
 -pipe -Wall -Werror=format-security
 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
 -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer '
 LDFLAGS=-Wl,-z,relro
 PKG_CONFIG_PATH=:/usr/lib64/pkgconfig:/usr/share/pkgconfig CXX=g++
 'CXXFLAGS=-O2 -flto=auto -ffat-lto-objects -fexceptions -g
 -grecord-gcc-switches -pipe -Wall -Werror=format-security
 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -march=x86-64
 -mtune=generic -fasynchronous-unwind-tables -fstack-clash-protection
 -fcf-protection -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ''

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 MODULES NATIVE_COMP NOTIFY INOTIFY
PDUMPER PGTK PNG RSVG SECCOMP SOUND SQLITE3 THREADS TIFF
TOOLKIT_SCROLL_BARS TREE_SITTER WEBP XIM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_US.UTF-8
  value of $XMODIFIERS: @im=ibus
  locale-coding-system: utf-8-unix

Major mode: Lisp Interaction

Minor modes in effect:
  display-line-numbers-mode: t
  vertico-mode: t
  global-corfu-mode: t
  corfu-mode: t
  marginalia-mode: t
  repeat-mode: t
  recentf-mode: t
  pixel-scroll-precision-mode: t
  global-so-long-mode: t
  electric-pair-mode: t
  desktop-save-mode: t
  override-global-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  horizontal-scroll-bar-mode: t
  context-menu-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  blink-cursor-mode: t
  line-number-mode: t
  indent-tabs-mode: t
  transient-mark-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  auto-save-visited-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr shortdoc net-utils help-fns radix-tree emacsbug
message mailcap yank-media puny dired dired-loaddefs rfc822 mml mml-sec
epa derived epg rfc6068 epg-config gnus-util mm-decode mm-bodies
mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail
rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util
ibuffer ibuffer-loaddefs comp comp-cstr rx time-date vc-git diff-mode vc
vc-dispatcher bug-reference jkm-fns sqlite display-line-numbers cc-mode
cc-fonts cc-guess cc-menus cc-cmds cc-styles cc-align cc-engine cc-vars
cc-defs init vertico corfu eglot external-completion array filenotify
jsonrpc ert pp ewoc debug backtrace find-func xref flymake-proc flymake
thingatpt warnings icons compile text-property-search comint ansi-osc
ansi-color pcase url-util url-parse auth-source eieio eieio-core
password-cache json map url-vars project byte-opt imenu orderless
marginalia compat compat-30 edmacro kmacro leuven-theme repeat recentf
tree-widget wid-edit pixel-scroll cua-base ring subr-x so-long elec-pair
desktop frameset cus-load cl-macs gv cl-extra help-mode cl-seq
use-package use-package-ensure use-package-delight use-package-diminish
use-package-bind-key bind-key easy-mmode use-package-core cl-loaddefs
cl-lib bytecomp byte-compile info bash-completion-autoloads
consult-git-log-grep-autoloads consult-ls-git-autoloads corfu-autoloads
debbugs-autoloads embark-consult-autoloads consult-autoloads
embark-autoloads leuven-theme-autoloads marginalia-autoloads
orderless-autoloads osm-autoloads pdf-tools-autoloads pyvenv-autoloads
rust-mode-autoloads tablist-autoloads vertico-autoloads compat-autoloads
rmc iso-transl tooltip cconv eldoc paren electric uniquify ediff-hook
vc-hooks lisp-float-type elisp-mode mwheel term/pgtk-win pgtk-win
term/common-win pgtk-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs theme-loaddefs faces cus-face macroexp
files window text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget keymap hashtable-print-readable backquote
threads xwidget-internal dbusbind inotify dynamic-setting
system-font-setting font-render-setting cairo gtk pgtk multi-tty
make-network-process native-compile emacs)

Memory information:
((conses 16 231270 29521)
 (symbols 48 18116 0)
 (strings 32 58629 2627)
 (string-bytes 1 2394496)
 (vectors 16 34305)
 (vector-slots 8 640740 25613)
 (floats 8 204 66)
 (intervals 56 496 35)
 (buffers 984 11))
[backtrace.txt (text/plain, attachment)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73337; Package emacs. (Wed, 18 Sep 2024 15:21:01 GMT) Full text and rfc822 format available.

Message #8 received at 73337 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Jonathan Mitchell <mitchell.jkyle <at> gmail.com>
Cc: 73337 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
Subject: Re: bug#73337: 29.4; missing dynamic type checking in
 network-lookup-address-info
Date: Wed, 18 Sep 2024 17:19:03 +0200
>>>>> On Wed, 18 Sep 2024 10:07:25 -0500, Jonathan Mitchell <mitchell.jkyle <at> gmail.com> said:

    Jonathan> There is no dynamic type checking of the ‘name’ argument in
    Jonathan> ‘network-lookup-address-info’, thus causing a crash instead of signaling
    Jonathan> a wrong-type-argument error when called with non-string values like
    Jonathan> ‘(network-lookup-address-info 1)’ or ‘(network-lookup-address-info ’a)’.

Yep. Eli, emacs-30?

diff --git a/src/process.c b/src/process.c
index 557bdfc918c..216cf916e34 100644
--- a/src/process.c
+++ b/src/process.c
@@ -4729,6 +4729,8 @@ DEFUN ("network-lookup-address-info", Fnetwork_lookup_address_info,
   struct addrinfo *res, *lres;
   struct addrinfo hints;
 
+  CHECK_STRING (name);
+
   memset (&hints, 0, sizeof hints);
   if (NILP (family))
     hints.ai_family = AF_UNSPEC;

Robert
-- 




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73337; Package emacs. (Wed, 18 Sep 2024 16:07:02 GMT) Full text and rfc822 format available.

Message #11 received at 73337 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Robert Pluim <rpluim <at> gmail.com>
Cc: 73337 <at> debbugs.gnu.org, mitchell.jkyle <at> gmail.com
Subject: Re: bug#73337: 29.4; missing dynamic type checking in
 network-lookup-address-info
Date: Wed, 18 Sep 2024 19:05:59 +0300
> From: Robert Pluim <rpluim <at> gmail.com>
> Cc: 73337 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
> Date: Wed, 18 Sep 2024 17:19:03 +0200
> 
> >>>>> On Wed, 18 Sep 2024 10:07:25 -0500, Jonathan Mitchell <mitchell.jkyle <at> gmail.com> said:
> 
>     Jonathan> There is no dynamic type checking of the ‘name’ argument in
>     Jonathan> ‘network-lookup-address-info’, thus causing a crash instead of signaling
>     Jonathan> a wrong-type-argument error when called with non-string values like
>     Jonathan> ‘(network-lookup-address-info 1)’ or ‘(network-lookup-address-info ’a)’.
> 
> Yep. Eli, emacs-30?

Yes, okay, but please also say in the doc string that NAME must be a
string.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#73337; Package emacs. (Thu, 19 Sep 2024 07:57:01 GMT) Full text and rfc822 format available.

Message #14 received at 73337 <at> debbugs.gnu.org (full text, mbox):

From: Robert Pluim <rpluim <at> gmail.com>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 73337 <at> debbugs.gnu.org, mitchell.jkyle <at> gmail.com
Subject: Re: bug#73337: 29.4; missing dynamic type checking in
 network-lookup-address-info
Date: Thu, 19 Sep 2024 09:54:35 +0200
tags 73337 fixed
close 73337 30.1
quit

>>>>> On Wed, 18 Sep 2024 19:05:59 +0300, Eli Zaretskii <eliz <at> gnu.org> said:

    >> From: Robert Pluim <rpluim <at> gmail.com>
    >> Cc: 73337 <at> debbugs.gnu.org, Eli Zaretskii <eliz <at> gnu.org>
    >> Date: Wed, 18 Sep 2024 17:19:03 +0200
    >> 
    >> >>>>> On Wed, 18 Sep 2024 10:07:25 -0500, Jonathan Mitchell <mitchell.jkyle <at> gmail.com> said:
    >> 
    Jonathan> There is no dynamic type checking of the ‘name’ argument in
    Jonathan> ‘network-lookup-address-info’, thus causing a crash instead of signaling
    Jonathan> a wrong-type-argument error when called with non-string values like
    Jonathan> ‘(network-lookup-address-info 1)’ or ‘(network-lookup-address-info ’a)’.
    >> 
    >> Yep. Eli, emacs-30?

    Eli> Yes, okay, but please also say in the doc string that NAME must be a
    Eli> string.

Closing.
Committed as 300d05ecb4c

Robert
-- 




Added tag(s) fixed. Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 19 Sep 2024 07:57:02 GMT) Full text and rfc822 format available.

bug marked as fixed in version 30.1, send any further explanations to 73337 <at> debbugs.gnu.org and Jonathan Mitchell <mitchell.jkyle <at> gmail.com> Request was from Robert Pluim <rpluim <at> gmail.com> to control <at> debbugs.gnu.org. (Thu, 19 Sep 2024 07:57:02 GMT) Full text and rfc822 format available.

bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 17 Oct 2024 11:24:09 GMT) Full text and rfc822 format available.

This bug report was last modified 247 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.