From owner-svn-src-all@FreeBSD.ORG Wed Nov 25 14:59:28 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E2E6B106568B; Wed, 25 Nov 2009 14:59:28 +0000 (UTC) (envelope-from attilio@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id D1E4B8FC19; Wed, 25 Nov 2009 14:59:28 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id nAPExSxc053744; Wed, 25 Nov 2009 14:59:28 GMT (envelope-from attilio@svn.freebsd.org) Received: (from attilio@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id nAPExS7C053742; Wed, 25 Nov 2009 14:59:28 GMT (envelope-from attilio@svn.freebsd.org) Message-Id: <200911251459.nAPExS7C053742@svn.freebsd.org> From: Attilio Rao Date: Wed, 25 Nov 2009 14:59:28 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r199802 - head/lib/libtacplus X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 25 Nov 2009 14:59:29 -0000 Author: attilio Date: Wed Nov 25 14:59:28 2009 New Revision: 199802 URL: http://svn.freebsd.org/changeset/base/199802 Log: In tac_get_av_value() empty attributes should be handled like 0-length strings rather than unset strings. Fix the present wrong behaviour. Obtained from: Sandvine Incorporated Reviewed by: emaste Sponsored by: Sandvine Incorporated MFC: 1 week Modified: head/lib/libtacplus/taclib.c Modified: head/lib/libtacplus/taclib.c ============================================================================== --- head/lib/libtacplus/taclib.c Wed Nov 25 14:57:07 2009 (r199801) +++ head/lib/libtacplus/taclib.c Wed Nov 25 14:59:28 2009 (r199802) @@ -1263,8 +1263,13 @@ tac_get_av_value(struct tac_handle *h, c * h->srvr_avs[0] = "foobie=var1" * h->srvr_avs[1] = "foo=var2" * is handled. + * + * Note that for empty string attribute values a + * 0-length string is returned in order to distinguish + * against unset values. + * dump_str() will handle srvr.len == 0 correctly. */ - if (found_seperator == 1 && ch != end) { + if (found_seperator == 1) { srvr.len = end - ch; srvr.data = ch; return dup_str(h, &srvr, NULL);