Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:80706 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 4912 invoked from network); 17 Jan 2015 19:38:38 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Jan 2015 19:38:38 -0000 Authentication-Results: pb1.pair.com header.from=honey@internot.info; sender-id=pass Authentication-Results: pb1.pair.com smtp.mail=honey@internot.info; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain internot.info designates 185.57.82.47 as permitted sender) X-PHP-List-Original-Sender: honey@internot.info X-Host-Fingerprint: 185.57.82.47 mail.internot.info Received: from [185.57.82.47] ([185.57.82.47:54237] helo=mail.internot.info) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 29/00-04095-C3ABAB45 for ; Sat, 17 Jan 2015 14:38:36 -0500 Message-ID: <54BABA33.7080206@internot.info> Date: Sun, 18 Jan 2015 06:38:27 +1100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 To: internals OpenPGP: id=296E6003; url=https://internot.info/docs/gpg_pubkey.asc.gpg Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="9fPBAUcpUOxk86ItrFsJQRviqhldhOCeQ" Subject: Removal of various checks? From: honey@internot.info (Joshua Rogers) --9fPBAUcpUOxk86ItrFsJQRviqhldhOCeQ Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, If this patch is accepted: https://github.com/php/php-src/pull/1001 Should the few checks that are made before it is called be removed? For example, in the /ext/phar/phar.c file: 1206 if (error) { 1207 spprintf(error, 0, "internal error: attempt t= o flush cached zip-based phar \"%s\"", phar->fname); 1208 } the a test is made correctly, to see whether error is NULL or not. But in the same function, a test is not made. 1219 if (entry.fp =3D=3D NULL) { 1220 spprintf(error, 0, "phar error: unable to cre= ate temporary file"); 1221 return EOF; 1222 } There are various other places that 'error'(pbuf) is not checked aganist NULL, which could cause null pointer dereferences. My question is, if the patch is accepted, should the "if (error) {"'s be removed, or should they be added to the expressions that are missing them= ? Does anybody know whether it would make the running time faster(by nano-seconds) to add the checks against 'error' before the spprintf() is used, or just to let spprintf() handle it. Does it matter? Thanks, --=20 -- Joshua Rogers --9fPBAUcpUOxk86ItrFsJQRviqhldhOCeQ Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iQIcBAEBAgAGBQJUuro0AAoJEJCcj5QpbmADS7wP/3SXZCAT5AlMd3E7kO1yy5WY EM13ouYUh2llcKZm71Boxkf1JDIPwU5aHHDef4WDwc8ltR2YHxo9QrPE8SrtxggZ E2ivz4/6Lq8+hBFeg3vSZ/XLBxT8uYFHsYKw9z4Wj82QKkapBbmovG8FFXoev+kr Tv98BSa11F1mMhfy9aRccLCl8bsr1a5YVRceK42jguywo99SyG0wLGz0Q0klTjXB XKFefy3vOrXD8Fh64zv+MVqk6fLxewDDHUIUzC3Zg2j+B5VZ9mXfcGTzkbIR4+ir FAJoto5YYwB46MzOh7QxJO93VWeeq5W9UzvnAoh1WKFf6oiUSrHhIUsHsajiGAPI gA+m4y/xOVwE9O++7TzbzKzaufRB4lAh3Pjr/0s538qS614zDwa29l1QULXGzHBc qyIVkFT5t0MuRQmNs4zGJHWs7gjMaNzu5zVMu5M2Nl3stpC3S3wRm6lWe/SX+Xut YcHYBFnlkKSZM15+B4N9Su8FKzTLdHJEAF7bARf3cTGEdaph97uHWkx1VL4tJuiJ c0jRIxZavvRSDpIkpLMlcD59Jq1xUdu/BYOBNpwzcR9dgi1pCxJrNtNFCQy9ngaM l46+fTCzwlIFuxGxoKcXhrPZT1CBjFK4rtmS9+YlxkA9XbCvYRNvfo6Uby1APytK TeMkG+toPdxBX/wxCbCL =bTqR -----END PGP SIGNATURE----- --9fPBAUcpUOxk86ItrFsJQRviqhldhOCeQ--