[vlc-devel] [vlc-commits] update: use U32_AT

Rafaël Carré funman at videolan.org
Tue Nov 18 11:50:17 CET 2014


On Tue, Nov 18, 2014 at 12:21:42PM +0300, Rémi Denis-Courmont wrote:
> Le 2014-11-18 11:31, Rafaël Carré a écrit :
> >On Mon, Nov 17, 2014 at 06:08:21PM +0100, Rémi Denis-Courmont wrote:
> >>vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Mon Nov
> >>17 19:08:10 2014 +0200| [3d9656b6cf4c629c8031125f869ce3b5a1f48e2d] |
> >>committer: Rémi Denis-Courmont
> >>
> >>update: use U32_AT
> >>
> >>> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=3d9656b6cf4c629c8031125f869ce3b5a1f48e2d
> >>---
> >>
> >> src/misc/update_crypto.c |    6 ++----
> >> 1 file changed, 2 insertions(+), 4 deletions(-)
> >>
> >>diff --git a/src/misc/update_crypto.c b/src/misc/update_crypto.c
> >>index 417b3ec..c935b03 100644
> >>--- a/src/misc/update_crypto.c
> >>+++ b/src/misc/update_crypto.c
> >>@@ -257,10 +257,8 @@ static size_t parse_signature_v4_packet(
> >>signature_packet_t *p_sig,
> >>         {
> >>             if( p + 4 > max_pos )
> >>                 return 0;
> >>-            i_subpacket_len = *++p << 24;
> >>-            i_subpacket_len += *++p << 16;
> >>-            i_subpacket_len += *++p << 8;
> >>-            i_subpacket_len += *++p;
> >>+            i_subpacket_len = U32_AT(p);
> >>+            p += 4;
> >
> >This code is not equivalent
> 
> Indeed the original code is undefined while the new code is defined from ISO
> C point of view (possibly not compatible with OpenPGP though).

Our users don't care about ISO C.

> >so obviously untested.
> 
> Indeed I do not usually test that code remains undefined, since I rarely
> strive for undefined code.

You should have read the spec for that code before changing it



More information about the vlc-devel mailing list