Skip to content

Commit

Permalink
doxygen2man: Check for strings longer than 4096
Browse files Browse the repository at this point in the history
  • Loading branch information
chrissie-c committed Oct 19, 2020
1 parent c09e99f commit ff98550
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions doxygen2man/doxygen2man.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@

#define _DEFAULT_SOURCE
#define _BSD_SOURCE
#define _GNU_SOURCE
#define _XOPEN_SOURCE
#define _XOPEN_SOURCE_EXTENDED
#include <stdlib.h>
Expand All @@ -33,6 +34,7 @@
#include <qb/qblist.h>
#include <qb/qbmap.h>
#include "cstring.h"

/*
* This isn't a maximum size, it just defines how long a parameter
* type can get before we decide it's not worth lining everything up.
Expand Down Expand Up @@ -499,10 +501,11 @@ static char *allcaps(const char *name)
size_t i;

if (name) {
for (i=0; i< strlen(name); i++) {
size_t len = strnlen(name, 4096);
for (i=0; i< len; i++) {
buffer[i] = toupper(name[i]);
}
buffer[strlen(name)] = '\0';
buffer[len] = '\0';
}
return buffer;
}
Expand Down

0 comments on commit ff98550

Please sign in to comment.