Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(57)

Side by Side Diff: openssl/crypto/comp/c_rle.c

Issue 9254031: Upgrade chrome's OpenSSL to same version Android ships with. (Closed) Base URL: http://src.chromium.org/svn/trunk/deps/third_party/openssl/
Patch Set: '' Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « openssl/crypto/comp/Makefile ('k') | openssl/crypto/comp/c_zlib.c » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #include <stdio.h> 1 #include <stdio.h>
2 #include <stdlib.h> 2 #include <stdlib.h>
3 #include <string.h> 3 #include <string.h>
4 #include <openssl/objects.h> 4 #include <openssl/objects.h>
5 #include <openssl/comp.h> 5 #include <openssl/comp.h>
6 6
7 static int rle_compress_block(COMP_CTX *ctx, unsigned char *out, 7 static int rle_compress_block(COMP_CTX *ctx, unsigned char *out,
8 unsigned int olen, unsigned char *in, unsigned int ilen); 8 unsigned int olen, unsigned char *in, unsigned int ilen);
9 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, 9 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
10 unsigned int olen, unsigned char *in, unsigned int ilen); 10 unsigned int olen, unsigned char *in, unsigned int ilen);
(...skipping 28 matching lines...) Expand all
39 *(out++)=0; 39 *(out++)=0;
40 memcpy(out,in,ilen); 40 memcpy(out,in,ilen);
41 return(ilen+1); 41 return(ilen+1);
42 } 42 }
43 43
44 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out, 44 static int rle_expand_block(COMP_CTX *ctx, unsigned char *out,
45 unsigned int olen, unsigned char *in, unsigned int ilen) 45 unsigned int olen, unsigned char *in, unsigned int ilen)
46 { 46 {
47 int i; 47 int i;
48 48
49 » if (olen < (ilen-1)) 49 » if (ilen == 0 || olen < (ilen-1))
50 { 50 {
51 /* ZZZZZZZZZZZZZZZZZZZZZZ */ 51 /* ZZZZZZZZZZZZZZZZZZZZZZ */
52 return(-1); 52 return(-1);
53 } 53 }
54 54
55 i= *(in++); 55 i= *(in++);
56 if (i == 0) 56 if (i == 0)
57 { 57 {
58 memcpy(out,in,ilen-1); 58 memcpy(out,in,ilen-1);
59 } 59 }
60 return(ilen-1); 60 return(ilen-1);
61 } 61 }
62
OLDNEW
« no previous file with comments | « openssl/crypto/comp/Makefile ('k') | openssl/crypto/comp/c_zlib.c » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698