diff options
author | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:23:57 +0000 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2009-09-04 12:23:57 +0000 |
commit | e310c6fb680eb33b2f1dbea5d88ca13d3536e160 (patch) | |
tree | 3c92f23f7de71b395ef3a622a13fb0a4f9925665 /src/fs/fs_uri.c | |
parent | 6726d9c371e0dbf4a3604c34e4a6043332372bd4 (diff) | |
download | gnunet-e310c6fb680eb33b2f1dbea5d88ca13d3536e160.tar.gz gnunet-e310c6fb680eb33b2f1dbea5d88ca13d3536e160.zip |
fixes
Diffstat (limited to 'src/fs/fs_uri.c')
-rw-r--r-- | src/fs/fs_uri.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/fs/fs_uri.c b/src/fs/fs_uri.c index 47bad3454..7959c37af 100644 --- a/src/fs/fs_uri.c +++ b/src/fs/fs_uri.c | |||
@@ -396,6 +396,7 @@ uri_chk_parse (const char *s, char **emsg) | |||
396 | struct GNUNET_FS_Uri *ret; | 396 | struct GNUNET_FS_Uri *ret; |
397 | struct FileIdentifier fi; | 397 | struct FileIdentifier fi; |
398 | unsigned int pos; | 398 | unsigned int pos; |
399 | unsigned long long flen; | ||
399 | size_t slen; | 400 | size_t slen; |
400 | char h1[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; | 401 | char h1[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; |
401 | char h2[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; | 402 | char h2[sizeof(struct GNUNET_CRYPTO_HashAsciiEncoded)]; |
@@ -429,12 +430,12 @@ uri_chk_parse (const char *s, char **emsg) | |||
429 | &fi.chk.query)) || | 430 | &fi.chk.query)) || |
430 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], | 431 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], |
431 | "%llu", | 432 | "%llu", |
432 | &fi.file_length))) | 433 | &flen)) ) |
433 | { | 434 | { |
434 | *emsg = GNUNET_strdup (_("Malformed CHK URI")); | 435 | *emsg = GNUNET_strdup (_("Malformed CHK URI")); |
435 | return NULL; | 436 | return NULL; |
436 | } | 437 | } |
437 | fi.file_length = GNUNET_htonll (fi.file_length); | 438 | fi.file_length = GNUNET_htonll (flen); |
438 | ret = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); | 439 | ret = GNUNET_malloc (sizeof(struct GNUNET_FS_Uri)); |
439 | ret->type = chk; | 440 | ret->type = chk; |
440 | ret->data.chk = fi; | 441 | ret->data.chk = fi; |
@@ -544,6 +545,7 @@ uri_loc_parse (const char *s, char **emsg) | |||
544 | unsigned int pos; | 545 | unsigned int pos; |
545 | unsigned int npos; | 546 | unsigned int npos; |
546 | unsigned long long exptime; | 547 | unsigned long long exptime; |
548 | unsigned long long flen; | ||
547 | struct GNUNET_TIME_Absolute et; | 549 | struct GNUNET_TIME_Absolute et; |
548 | struct GNUNET_CRYPTO_RsaSignature sig; | 550 | struct GNUNET_CRYPTO_RsaSignature sig; |
549 | struct LocUriAssembly ass; | 551 | struct LocUriAssembly ass; |
@@ -578,12 +580,12 @@ uri_loc_parse (const char *s, char **emsg) | |||
578 | &ass.fi.chk.query)) || | 580 | &ass.fi.chk.query)) || |
579 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], | 581 | (1 != SSCANF (&s[pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2], |
580 | "%llu", | 582 | "%llu", |
581 | &ass.fi.file_length)) ) | 583 | &flen)) ) |
582 | { | 584 | { |
583 | *emsg = GNUNET_strdup (_("SKS URI malformed")); | 585 | *emsg = GNUNET_strdup (_("SKS URI malformed")); |
584 | return NULL; | 586 | return NULL; |
585 | } | 587 | } |
586 | ass.fi.file_length = GNUNET_htonll (ass.fi.file_length); | 588 | ass.fi.file_length = GNUNET_htonll (flen); |
587 | 589 | ||
588 | npos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2; | 590 | npos = pos + sizeof (struct GNUNET_CRYPTO_HashAsciiEncoded) * 2; |
589 | while ((s[npos] != '\0') && (s[npos] != '.')) | 591 | while ((s[npos] != '\0') && (s[npos] != '.')) |