summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2015-08-08 13:49:04 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2015-08-08 17:38:18 -0700
commit56bd759df1d0c750a065b8c845e93d5dfa6b549d (patch)
tree3f91093cdb475e565ae857f1c5a7fd339e2d781e /x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff
downloadgentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.gz
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.tar.bz2
gentoo-56bd759df1d0c750a065b8c845e93d5dfa6b549d.zip
proj/gentoo: Initial commit
This commit represents a new era for Gentoo: Storing the gentoo-x86 tree in Git, as converted from CVS. This commit is the start of the NEW history. Any historical data is intended to be grafted onto this point. Creation process: 1. Take final CVS checkout snapshot 2. Remove ALL ChangeLog* files 3. Transform all Manifests to thin 4. Remove empty Manifests 5. Convert all stale $Header$/$Id$ CVS keywords to non-expanded Git $Id$ 5.1. Do not touch files with -kb/-ko keyword flags. Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> X-Thanks: Alec Warner <antarus@gentoo.org> - did the GSoC 2006 migration tests X-Thanks: Robin H. Johnson <robbat2@gentoo.org> - infra guy, herding this project X-Thanks: Nguyen Thai Ngoc Duy <pclouds@gentoo.org> - Former Gentoo developer, wrote Git features for the migration X-Thanks: Brian Harring <ferringb@gentoo.org> - wrote much python to improve cvs2svn X-Thanks: Rich Freeman <rich0@gentoo.org> - validation scripts X-Thanks: Patrick Lauer <patrick@gentoo.org> - Gentoo dev, running new 2014 work in migration X-Thanks: Michał Górny <mgorny@gentoo.org> - scripts, QA, nagging X-Thanks: All of other Gentoo developers - many ideas and lots of paint on the bikeshed
Diffstat (limited to 'x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff')
-rw-r--r--x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff105
1 files changed, 105 insertions, 0 deletions
diff --git a/x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff b/x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff
new file mode 100644
index 000000000000..df961e607e4f
--- /dev/null
+++ b/x11-misc/bbacpi/files/bbacpi-0.1.5-overflows.diff
@@ -0,0 +1,105 @@
+Fixes buffer overflows and --as-needed issues
+
+https://bugs.gentoo.org/show_bug.cgi?id=338936
+
+Patch written by Kevin Pyle <gentoo.8eaf7cd8e5128d8191fe@spamgourmet.com>
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -1,4 +1,4 @@
+-AM_CPPFLAGS = @CPPFLAGS@ @INTERLACE@ \
++AM_CPPFLAGS = @INTERLACE@ \
+ -DGLOBAL_BB=\"$(datadir)/bbtools/bbacpi.bb\" \
+ -DGLOBAL_NOBB=\"$(datadir)/bbtools/bbacpi.nobb\" \
+ -DGLOBAL_DATA=\"$(datadir)/bbtools\"
+--- a/bbacpi.cc
++++ b/bbacpi.cc
+@@ -167,7 +167,7 @@ bool CheckLoad::checkbatteryfile (char* name, char* device)
+ if (ret = (fp = fopen(name, "r"))) {
+ char buffer[100];
+ char present[20];
+- fgets(buffer,128,fp);
++ fgets(buffer, sizeof(buffer),fp);
+ sscanf(buffer,"present: %s", present);
+ if (strncmp(present, "yes", 3) != 0) {
+ fprintf(stderr, "Device %s not present.\n", device);
+@@ -195,7 +195,7 @@ void CheckLoad::ReadStaticInfo()
+ {
+ /* Read data in any order */
+ found = 0;
+- while (found < 11 && (fgets(buffer, 63, fp) != NULL)) {
++ while (found < 11 && (fgets(buffer, sizeof(buffer), fp) != NULL)) {
+ /* Present */
+ if (strncmp(buffer, "present:", 7) == 0
+ || strncmp(buffer, "Present:", 7) == 0) {
+@@ -277,7 +277,7 @@ void CheckLoad::ReadStaticInfo()
+ {
+ /* Read data in any order */
+ found = 0;
+- while (found < 11 && (fgets(buffer, 63, fp) != NULL)) {
++ while (found < 11 && (fgets(buffer, sizeof(buffer), fp) != NULL)) {
+ /* Present */
+ if (strncmp(buffer, "present:", 7) == 0
+ || strncmp(buffer, "Present:", 7) == 0) {
+@@ -361,7 +361,7 @@ void CheckLoad::ReadStaticInfo()
+ if ((fp = fopen(names.temptrip, "r")))
+ {
+ found = 0;
+- while (found < 2 && (fgets(buffer,128,fp) != NULL)) {
++ while (found < 2 && (fgets(buffer, sizeof(buffer),fp) != NULL)) {
+ /* Critical */
+ if (strncmp(buffer, "critical", 8) == 0
+ || strncmp(buffer, "Critical", 8) == 0) {
+@@ -425,7 +425,7 @@ void CheckLoad::Reconfigure()
+ if (file_status.st_mtime != last_mtime)
+ {
+ found = 0;
+- while (found < 4 && (fgets(buffer, 63, fp) != NULL)) {
++ while (found < 4 && (fgets(buffer, sizeof(buffer), fp) != NULL)) {
+ /* Charging state */
+ if (strncmp(buffer, "charging state:", 15) == 0
+ || strncmp(buffer, "Charging State:", 15) == 0) {
+@@ -463,7 +463,7 @@ void CheckLoad::Reconfigure()
+ if (file_status.st_mtime != last_mtime)
+ {
+ found = 0;
+- while (found < 4 && (fgets(buffer, 63, fp) != NULL)) {
++ while (found < 4 && (fgets(buffer, sizeof(buffer), fp) != NULL)) {
+ /* Charging state */
+ if (strncmp(buffer, "charging state:", 15) == 0
+ || strncmp(buffer, "Charging State:", 15) == 0) {
+@@ -497,7 +497,7 @@ void CheckLoad::Reconfigure()
+ if ((fp = fopen(names.adapter, "r")))
+ {
+ found = 0;
+- while (found < 1 && (fgets(buffer, 63,fp) != NULL)) {
++ while (found < 1 && (fgets(buffer, sizeof(buffer),fp) != NULL)) {
+ if (strncmp(buffer, "state:", 6) == 0
+ || strncmp(buffer, "State:", 6) == 0) {
+ sscanf(buffer+offset,"%s", adapter.state);
+@@ -511,7 +511,7 @@ void CheckLoad::Reconfigure()
+ if ((fp = fopen(names.temperature, "r")))
+ {
+ found = 0;
+- while (found < 1 && (fgets(buffer, 63,fp) != NULL)) {
++ while (found < 1 && (fgets(buffer, sizeof(buffer),fp) != NULL)) {
+ if (strncmp(buffer, "temperature:", 12) == 0
+ || strncmp(buffer, "Temperature:", 12) == 0) {
+ sscanf(buffer+offset,"%u", &temperature.celcius);
+--- a/configure.in
++++ b/configure.in
+@@ -89,12 +89,12 @@ AC_PATH_XTRA
+
+ CFLAGS="$CFLAGS $X_CFLAGS"
+ CXXFLAGS="$CXXFLAGS $X_CFLAGS"
+-LDFLAGS="$LDFLAGS $X_LIBS $X_PRE_LIBS"
++LIBS="$LIBS $X_LIBS $X_PRE_LIBS"
+ dnl Checks for X libraries.
+-AC_CHECK_LIB(X11, XOpenDisplay, LDFLAGS="$LDFLAGS -lX11",
++AC_CHECK_LIB(X11, XOpenDisplay,,
+ AC_MSG_ERROR(XOpenDisplay not found in -lX11))
+
+-LDFLAGS="$LDFLAGS $X_EXTRA_LIBS"
++LIBS="$LIBS $X_EXTRA_LIBS"
+
+ dnl Check for Imlib
+ AC_MSG_CHECKING([for Imlib])