Selaa lähdekoodia

Fix very silly segfault.

Scott James Remnant 22 vuotta sitten
vanhempi
commit
e7a0477f97
3 muutettua tiedostoa jossa 10 lisäystä ja 2 poistoa
  1. 6 0
      ChangeLog
  2. 2 0
      debian/changelog
  3. 2 2
      main/enquiry.c

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+Thu May 6 23:50:17 BST 2004 Daniel Kobras <kobras@debian.org>
+
+  * main/enquiry.c: Remove dereference of unitialised and unused pointer
+  variable, fixing segfault on when "gcc -dumpmachine" returns a
+  non-matching triplet.
+
 Thu May 6 23:44:55 BST 2004 Colin Watson <cjwatson@debian.org>
 
   * dselect/helpmsgs.cc: Pressing 'n' repeats the last search, not

+ 2 - 0
debian/changelog

@@ -6,6 +6,8 @@ dpkg (1.10.22) unstable; urgency=low
     properly again.  Closes: #246595.
   * Make dpkg-scanpackages output Origin and Bugs fields with proper
     casing.  Closes: #154422.
+  * Fix segfault when "gcc -dumpmachine" returns a non-matching triplet.
+    Closes: #211850.
   * Correct 'n' and 'p' key descriptions in dselect help message.
     Closes: #120562.
   * Stop hardcoding the list of manual page languages in debian/rules,

+ 2 - 2
main/enquiry.c

@@ -402,7 +402,7 @@ void printarch(const char *const *argv) {
   FILE *ccpipe;
   struct varbuf vb;
   ptrdiff_t ll;
-  char *p, *q;
+  char *p;
 
   if (*argv) badusage(_("--print-architecture does not take any argument"));
 
@@ -445,7 +445,7 @@ void printarch(const char *const *argv) {
   default: internerr("unknown action in printarch");
   }
   if (!arch) {
-    *q= 0; arch= p;
+    arch= p;
     fprintf(stderr, _("dpkg: warning, architecture `%s' not in remapping table\n"),arch);
   }
   if (printf("%s\n",arch) == EOF) werr("stdout");