aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/c-ares/ares_expand_name.c
diff options
context:
space:
mode:
authorsnermolaev <snermolaev@yandex-team.ru>2022-02-10 16:45:53 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:53 +0300
commit7353a3fdea9c67c256980c00a2b3b67f09b23a27 (patch)
tree1a2c5ffcf89eb53ecd79dbc9bc0a195c27404d0c /contrib/libs/c-ares/ares_expand_name.c
parent2015790ac9fcc04caab83fccc23ab2460310a797 (diff)
downloadydb-7353a3fdea9c67c256980c00a2b3b67f09b23a27.tar.gz
Restoring authorship annotation for <snermolaev@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'contrib/libs/c-ares/ares_expand_name.c')
-rw-r--r--contrib/libs/c-ares/ares_expand_name.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/contrib/libs/c-ares/ares_expand_name.c b/contrib/libs/c-ares/ares_expand_name.c
index 9d7594f3f7..3a38e6737e 100644
--- a/contrib/libs/c-ares/ares_expand_name.c
+++ b/contrib/libs/c-ares/ares_expand_name.c
@@ -32,9 +32,9 @@
#include "ares_nowarn.h"
#include "ares_private.h" /* for the memdebug */
-/* Maximum number of indirections allowed for a name */
-#define MAX_INDIRS 50
-
+/* Maximum number of indirections allowed for a name */
+#define MAX_INDIRS 50
+
static int name_length(const unsigned char *encoded, const unsigned char *abuf,
int alen);
@@ -69,7 +69,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
char *q;
const unsigned char *p;
union {
- ares_ssize_t sig;
+ ares_ssize_t sig;
size_t uns;
} nlen;
@@ -77,7 +77,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
if (nlen.sig < 0)
return ARES_EBADNAME;
- *s = ares_malloc(nlen.uns + 1);
+ *s = ares_malloc(nlen.uns + 1);
if (!*s)
return ARES_ENOMEM;
q = *s;
@@ -132,7 +132,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
if (q > *s)
*(q - 1) = 0;
else
- *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */
+ *q = 0; /* zero terminate; LCOV_EXCL_LINE: empty names exit above */
return ARES_SUCCESS;
}
@@ -143,7 +143,7 @@ int ares_expand_name(const unsigned char *encoded, const unsigned char *abuf,
static int name_length(const unsigned char *encoded, const unsigned char *abuf,
int alen)
{
- int n = 0, offset, indir = 0, top;
+ int n = 0, offset, indir = 0, top;
/* Allow the caller to pass us abuf + alen and have us check for it. */
if (encoded >= abuf + alen)
@@ -151,8 +151,8 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
while (*encoded)
{
- top = (*encoded & INDIR_MASK);
- if (top == INDIR_MASK)
+ top = (*encoded & INDIR_MASK);
+ if (top == INDIR_MASK)
{
/* Check the offset and go there. */
if (encoded + 1 >= abuf + alen)
@@ -165,11 +165,11 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
/* If we've seen more indirects than the message length,
* then there's a loop.
*/
- ++indir;
- if (indir > alen || indir > MAX_INDIRS)
+ ++indir;
+ if (indir > alen || indir > MAX_INDIRS)
return -1;
}
- else if (top == 0x00)
+ else if (top == 0x00)
{
offset = *encoded;
if (encoded + offset + 1 >= abuf + alen)
@@ -182,13 +182,13 @@ static int name_length(const unsigned char *encoded, const unsigned char *abuf,
}
n++;
}
- else
- {
- /* RFC 1035 4.1.4 says other options (01, 10) for top 2
- * bits are reserved.
- */
- return -1;
- }
+ else
+ {
+ /* RFC 1035 4.1.4 says other options (01, 10) for top 2
+ * bits are reserved.
+ */
+ return -1;
+ }
}
/* If there were any labels at all, then the number of dots is one