NetBSD Problem Report #55190

From  Tue Apr 21 03:42:31 2020
Return-Path: <>
Received: from ( [])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "", Issuer " CA" (not verified))
	by (Postfix) with ESMTPS id 4719E1A924D
	for <>; Tue, 21 Apr 2020 03:42:31 +0000 (UTC)
Message-Id: <>
Date: Tue, 21 Apr 2020 15:42:24 +1200 (NZST)
Subject: A bogus error message can be reported by kadmin
X-Send-Pr-Version: 3.95

>Number:         55190
>Category:       bin
>Synopsis:       A bogus error message can be reported by kadmin
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    bin-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Apr 21 03:45:00 +0000 2020
>Originator:     Duncan McEwan
>Release:        NetBSD 8.1_STABLE
	School of Engineering and Computer Science,
        Victoria University of Wellington
System: NetBSD 8.1_STABLE NetBSD 8.1_STABLE (GENERIC) #4: Sun Jan 12 17:21:45 NZDT 2020 amd64
Architecture: x86_64
Machine: amd64
	kadmin sometimes reports the error message "sl_loop: out of memory"
        when the problem has nothing to do with running out of memory.

        This is tangentially related to PR #55145, in that the bug reported
        in that PR can trigger the above misleading error message.  But
        the message can also be produced independently of that bug.
        For eg: Attempt to set a password ending with a '"' character.
        kdc# kadmin -l
        kadmin> cpw --password=asdfdf" duncan
        sl_loop: out of memory
        In the above example the problem isn't that kadmin ran out of
        memory.  It just didn't like the unescaped single '"' character.

        The problem is caused by this code in sl.c in the function

        ret = sl_make_argv(buf, &argc, &argv);
        if(ret) {
            fprintf(stderr, "sl_loop: out of memory\n");
            return -1;

        But sl_make_argv() doesn't only fail with ENOMEM.  For other parsing
        errors it returns ERANGE ("Result too large or too small").

        This would hardly be an ideal error message either. But if the error
        return from sl_make_argv() is constrained to be a UNIX errno there
        probably isn't an great option.  Perhaps EINVAL might be better?

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD:,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.